> Please add the diff(1) program exit codes and their meanings to the
> manual page.

The man page is generated from the --help output by help2man. The attached patch includes the exit status documentation in the help messages for diff, diff3, cmp and sdiff.

patch does not AFAIK have the same tri-state exit status logic so I didn't touch that.

The patch was generated against the Debian source for diffutils 2.8.1-12.

ttfn/rjk
=== modified file 'src/cmp.c'
--- src/cmp.c   2008-04-21 18:07:17 +0000
+++ src/cmp.c   2008-04-21 18:19:04 +0000
@@ -179,12 +179,14 @@
   printf ("%s\n\n", _("Compare two files byte by byte."));
   for (p = option_help_msgid;  *p;  p++)
     printf ("  %s\n", _(*p));
-  printf ("\n%s\n%s\n\n%s\n\n%s\n",
+  printf ("\n%s\n%s\n\n%s\n\n%s\n%s\n\n%s\n",
          _("SKIP1 and SKIP2 are the number of bytes to skip in each file."),
          _("SKIP values may be followed by the following multiplicative 
suffixes:\n\
 kB 1000, K 1024, MB 1,000,000, M 1,048,576,\n\
 GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y."),
          _("If a FILE is `-' or missing, read standard input."),
+         _("An exit status of 0 means no differences were found, 1 means 
some"),
+         _("differences were found, and 2 means trouble."),
          _("Report bugs to <[EMAIL PROTECTED]>."));
 }
 

=== modified file 'src/diff.c'
--- src/diff.c  2008-04-21 18:07:17 +0000
+++ src/diff.c  2008-04-21 18:19:04 +0000
@@ -908,6 +908,9 @@
   N_("If --from-file or --to-file is given, there are no restrictions on 
FILES."),
   N_("If a FILE is `-', read standard input."),
   "",
+  N_("An exit status of 0 means no differences were found, 1 means some"),
+  N_("differences were found, and 2 means trouble."),
+  "",
   N_("Report bugs to <[EMAIL PROTECTED]>."),
   0
 };

=== modified file 'src/diff3.c'
--- src/diff3.c 2008-04-21 18:07:17 +0000
+++ src/diff3.c 2008-04-21 18:19:04 +0000
@@ -470,8 +470,10 @@
       printf ("  %s\n", _(*p));
     else
       putchar ('\n');
-  printf ("\n%s\n\n%s\n",
+  printf ("\n%s\n\n%s\n%s\n\n%s\n",
          _("If a FILE is `-', read standard input."),
+         _("An exit status of 0 means `diff3' was successful, 1 means some"),
+         _("conflicts were found, and 2 means trouble."),
          _("Report bugs to <[EMAIL PROTECTED]>."));
 }
 

=== modified file 'src/sdiff.c'
--- src/sdiff.c 2008-04-21 18:07:17 +0000
+++ src/sdiff.c 2008-04-21 18:19:04 +0000
@@ -218,8 +218,10 @@
       printf ("  %s\n", _(*p));
     else
       putchar ('\n');
-  printf ("\n%s\n\n%s\n",
+  printf ("\n%s\n\n%s\n%s\n\n%s\n",
          _("If a FILE is `-', read standard input."),
+         _("An exit status of 0 means no differences were found, 1 means 
some"),
+         _("differences were found, and 2 means trouble."),
          _("Report bugs to <[EMAIL PROTECTED]>."));
 }
 

Reply via email to