Hi,

The first patch adds the missing comma after option "-b" in
the help text of diff.  The second patch expands the word PAT
to the more readable PATTERN after option "-x".  Apply these
two patches please only after release of 3.1 -- or now if there
will be a pre2.

The third patch discards the strange output mechanism for the
help text and makes it similar to those of cmp, diff and sdiff.
Four text lines are moved from option_help_msgid[] to their own
printf() statement to avoid getting these lines strangely indented
in translation -- in Dutch for example the exit status line would
get indented by two spaces.  It also makes continuation lines
get aligned in the same fashion across the four programs.

(Please CC, not subscribed.)

Regards,

Benno

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again

From b6f744b1d0b90cda434c98733fbaba1e63e6d0b3 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <[email protected]>
Date: Sun, 7 Aug 2011 20:03:54 +0200
Subject: [PATCH 1/3] diff: (tiniest of corrections) add missing comma

* src/diff.c (option_help_msgid): add missing comma for consistency
---
 src/diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/diff.c b/src/diff.c
index fb8a2bc..6a08f36 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -880,7 +880,7 @@ static char const * const option_help_msgid[] = {
   "",
   N_("-i, --ignore-case               ignore case differences in file contents"),
   N_("-E, --ignore-tab-expansion      ignore changes due to tab expansion"),
-  N_("-b  --ignore-space-change       ignore changes in the amount of white space"),
+  N_("-b, --ignore-space-change       ignore changes in the amount of white space"),
   N_("-w, --ignore-all-space          ignore all white space"),
   N_("-B, --ignore-blank-lines        ignore changes whose lines are all blank"),
   N_("-I, --ignore-matching-lines=RE  ignore changes whose lines all match RE"),
-- 
1.7.0.4

From b997f7b2530643368172be82a592ca8d6f491d9c Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <[email protected]>
Date: Sun, 7 Aug 2011 20:08:19 +0200
Subject: [PATCH 2/3] diff: (tiny improvement) use full word instead of abbreviation

* src/diff.c (option_help_msgid): full word instead of abbrev
---
 src/diff.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/diff.c b/src/diff.c
index 6a08f36..1498c9c 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -870,7 +870,7 @@ static char const * const option_help_msgid[] = {
   N_("    --unidirectional-new-file   treat absent first files as empty"),
   N_("    --ignore-file-name-case     ignore case when comparing file names"),
   N_("    --no-ignore-file-name-case  consider case when comparing file names"),
-  N_("-x, --exclude=PAT               exclude files that match PAT"),
+  N_("-x, --exclude=PATTERN           exclude files that match PATTERN"),
   N_("-X, --exclude-from=FILE         exclude files that match any pattern in FILE"),
   N_("-S, --starting-file=FILE        start with FILE when comparing directories"),
   N_("    --from-file=FILE1           compare FILE1 to all operands;\n"
-- 
1.7.0.4

From b5734bd3fe6c70f5a18d221d313bbb472dc6a500 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <[email protected]>
Date: Sun, 7 Aug 2011 20:11:23 +0200
Subject: [PATCH 3/3] diff: simplify the manner of outputting the help text

* src/diff.c (option_help_msgid, usage): Make the output mechanism
of the help text as simple as for cmp, diff3 and sdiff, thus also
making indentation of translations align in the same fashion.
---
 src/diff.c |   23 ++++++-----------------
 1 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/diff.c b/src/diff.c
index 1498c9c..00de218 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -926,11 +926,6 @@ static char const * const option_help_msgid[] = {
   "",
   N_("    --help               display this help and exit"),
   N_("-v, --version            output version information and exit"),
-  "",
-  N_("FILES are `FILE1 FILE2' or `DIR1 DIR2' or `DIR FILE...' or `FILE... DIR'."),
-  N_("If --from-file or --to-file is given, there are no restrictions on FILE(s)."),
-  N_("If a FILE is `-', read standard input."),
-  N_("Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."),
   0
 };
 
@@ -951,19 +946,13 @@ Mandatory arguments to long options are mandatory for short options too.\n\
       if (!**p)
 	putchar ('\n');
       else
-	{
-	  char const *msg = _(*p);
-	  char const *nl;
-	  while ((nl = strchr (msg, '\n')))
-	    {
-	      int msglen = nl + 1 - msg;
-	      printf ("  %.*s", msglen, msg);
-	      msg = nl + 1;
-	    }
-
-	  printf ("  %s\n" + 2 * (*msg != ' ' && *msg != '-'), msg);
-	}
+	printf ("  %s\n", _(*p));
     }
+  printf ("\n%s\n%s\n%s\n%s\n",
+	  _("FILES are `FILE1 FILE2' or `DIR1 DIR2' or `DIR FILE...' or `FILE... DIR'."),
+	  _("If --from-file or --to-file is given, there are no restrictions on FILE(s)."),
+	  _("If a FILE is `-', read standard input."),
+	  _("Exit status is 0 if inputs are the same, 1 if different, 2 if trouble."));
   emit_bug_reporting_address ();
 }
 
-- 
1.7.0.4

Reply via email to