summaryrefslogtreecommitdiff
path: root/src/comm.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-10-23 15:37:19 +0000
committerJim Meyering <jim@meyering.net>1993-10-23 15:37:19 +0000
commitb869639f4661488eba0bb2d08020c6e71bb72627 (patch)
treee325845ec7ca06b4d59fcc07e87020897c7c4d9b /src/comm.c
parentd1df8c198d8878b77d1d1583bc7b3c491534616a (diff)
downloadcoreutils-b869639f4661488eba0bb2d08020c6e71bb72627.tar.xz
merge with 1.8d+
Diffstat (limited to 'src/comm.c')
-rw-r--r--src/comm.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/comm.c b/src/comm.c
index 1900661cd..2fc538526 100644
--- a/src/comm.c
+++ b/src/comm.c
@@ -99,7 +99,7 @@ main (argc, argv)
break;
default:
- usage ();
+ usage (1);
}
if (show_version)
@@ -109,10 +109,10 @@ main (argc, argv)
}
if (show_help)
- usage ();
+ usage (0);
if (optind + 2 != argc)
- usage ();
+ usage (1);
exit (compare_files (argv + optind));
}
@@ -251,9 +251,26 @@ writeline (line, stream, class)
}
static void
-usage ()
+usage (status)
+ int status;
{
- fprintf (stderr, "Usage: %s [-123] [--help] [--version] file1 file2\n",
- program_name);
- exit (1);
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
+Usage: %s [OPTION]... LEFT_FILE RIGHT_FILE\n\
+",
+ program_name);
+ printf ("\
+\n\
+ -1 suppress lines unique to left file\n\
+ -2 suppress lines unique to right file\n\
+ -3 suppress lines unique to both files\n\
+ --help display this help and exit\n\
+ --version output version information and exit\n\
+");
+ }
+ exit (status);
}