diff options
Diffstat (limited to 'src/cksum.c')
-rw-r--r-- | src/cksum.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/cksum.c b/src/cksum.c index f6f7d26a3..135864151 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -271,11 +271,25 @@ cksum (file, print_name) } static void -usage () +usage (status) + int status; { - fprintf (stderr, "\ -Usage: %s [--help] [--version] [file...]\n", program_name); - exit (1); + if (status != 0) + fprintf (stderr, "Try `%s --help' for more information.\n", + program_name); + else + { + printf ("\ +Usage: %s [OPTION]... [FILE]...\n\ +", + program_name); + printf ("\ +\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ +"); + } + exit (status); } void @@ -297,7 +311,7 @@ main (argc, argv) break; default: - usage (); + usage (1); } } @@ -308,7 +322,7 @@ main (argc, argv) } if (show_help) - usage (); + usage (0); if (optind >= argc) { |