summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--NEWS2
-rw-r--r--doc/diff.texi4
-rw-r--r--src/sdiff.c23
4 files changed, 25 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index d61c88c..993f71b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-06-06 Paul Eggert <eggert@cs.ucla.edu>
+
+ * NEWS: Mention new sdiff aliases 1 and 2 for l and r.
+ * doc/diff.texi (Merge Commands): Likewise.
+ * src/sdiff.c (give_help): Give help for them.
+ (edit): Support them.
+
2007-04-11 Paul Eggert <eggert@cs.ucla.edu>
* doc/diff.texi (Detailed diff3 Normal): "range is a singleton" ->
diff --git a/NEWS b/NEWS
index b2a4b5e..d1bdb45 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ User-visible changes since 2.8.7 (in "version" 2.8.7-cvs):
"Utility Syntax Guidelines" in the Minutes of the January 2005
Meeting <http://www.opengroup.org/austin/docs/austin_239.html>.
+* sdiff now understands '1' and '2' as synonyms for 'l' and 'r'.
+
Version 2.8.7 contains no user-visible changes.
User-visible changes in version 2.8.6:
diff --git a/doc/diff.texi b/doc/diff.texi
index 02cbaad..a80dd43 100644
--- a/doc/diff.texi
+++ b/doc/diff.texi
@@ -2466,18 +2466,22 @@ Like @samp{eb}, except precede each version with a header that
shows what file and lines the version came from.
@item el
+@itemx e1
Edit a copy of the left version, then copy the result to the output.
@item er
+@itemx e2
Edit a copy of the right version, then copy the result to the output.
@item l
+@itemx 1
Copy the left version to the output.
@item q
Quit.
@item r
+@itemx 2
Copy the right version to the output.
@item s
diff --git a/src/sdiff.c b/src/sdiff.c
index fb74ecc..9bed8ba 100644
--- a/src/sdiff.c
+++ b/src/sdiff.c
@@ -864,11 +864,11 @@ give_help (void)
fprintf (stderr, "%s", _("\
ed:\tEdit then use both versions, each decorated with a header.\n\
eb:\tEdit then use both versions.\n\
-el:\tEdit then use the left version.\n\
-er:\tEdit then use the right version.\n\
-e:\tEdit a new version.\n\
-l:\tUse the left version.\n\
-r:\tUse the right version.\n\
+el or e1:\tEdit then use the left version.\n\
+er or e2:\tEdit then use the right version.\n\
+e:\tDiscard both versions then edit a new one.\n\
+l or 1:\tUse the left version.\n\
+r or 2:\tUse the right version.\n\
s:\tSilently include common lines.\n\
v:\tVerbosely include common lines.\n\
q:\tQuit.\n\
@@ -923,7 +923,8 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
cmd0 = skip_white ();
switch (cmd0)
{
- case 'l': case 'r': case 's': case 'v': case 'q':
+ case '1': case '2': case 'l': case 'r':
+ case 's': case 'v': case 'q':
if (skip_white () != '\n')
{
give_help ();
@@ -937,7 +938,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
cmd1 = skip_white ();
switch (cmd1)
{
- case 'b': case 'd': case 'l': case 'r':
+ case '1': case '2': case 'b': case 'd': case 'l': case 'r':
if (skip_white () != '\n')
{
give_help ();
@@ -975,11 +976,11 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
switch (cmd0)
{
- case 'l':
+ case '1': case 'l':
lf_copy (left, llen, outfile);
lf_skip (right, rlen);
return true;
- case 'r':
+ case '2': case 'r':
lf_copy (right, rlen, outfile);
lf_skip (left, llen);
return true;
@@ -1020,7 +1021,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
(long int) (lline + llen - 1));
}
/* Fall through. */
- case 'b': case 'l':
+ case '1': case 'b': case 'l':
lf_copy (left, llen, tmp);
break;
@@ -1042,7 +1043,7 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
(long int) (rline + rlen - 1));
}
/* Fall through. */
- case 'b': case 'r':
+ case '2': case 'b': case 'r':
lf_copy (right, rlen, tmp);
break;