diff options
author | Jim Meyering <jim@meyering.net> | 1995-07-20 19:10:08 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1995-07-20 19:10:08 +0000 |
commit | 3d699e8ee0aa2b0ebf63596e876f63a9a5bb73cc (patch) | |
tree | cdb5d27f0c7bda15a1069850d8c230721a9dc366 /src/md5sum.c | |
parent | e20e0ba392cdb007ae14ecea7476d54904236bf9 (diff) | |
download | coreutils-3d699e8ee0aa2b0ebf63596e876f63a9a5bb73cc.tar.xz |
(usage): Move it to precede all other functions.
Fiddle comments.
Diffstat (limited to 'src/md5sum.c')
-rw-r--r-- | src/md5sum.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/md5sum.c b/src/md5sum.c index 76495c102..d44dca9e4 100644 --- a/src/md5sum.c +++ b/src/md5sum.c @@ -31,8 +31,8 @@ #include "error.h" #include "version.h" -/* Most systems does not make a difference between internal and external - text representation. */ +/* Most systems do not distinguish between external and internal + text representations. */ #if UNIX || __UNIX__ || unix || __unix__ || _POSIX_VERSION # define OPENOPTS "r" #else @@ -87,6 +87,40 @@ static const struct option long_options[] = char *xmalloc (); +static void +usage (status) + int status; +{ + if (status != 0) + fprintf (stderr, _("Try `%s --help' for more information.\n"), + program_name); + else + printf (_("\ +Usage: %s [OPTION] [FILE]...\n\ + or: %s [OPTION] --string=STRING\n\ + or: %s [OPTION] --check [FILE]\n\ +Print or check MD5 checksums.\n\ +With no FILE, or when FILE is -, read standard input.\n\ +\n\ + -h, --help display this help and exit\n\ + -q, --quiet don't show anything, status code shows success\n\ + -v, --verbose verbose output level\n\ + -V, --version output version information and exit\n\ +\n\ + -b, --binary read files in binary mode (default)\n\ + -t, --text read files in text mode\n\ +\n\ + -c, --check check MD5 sums against given list\n\ + -s, --string=STRING compute checksum for STRING\n\ +\n\ +The sums are computed as described in RFC 1321. When checking, the input\n\ +should be a former output of this program. The default mode is to print\n\ +a line with checksum, type, and name for each FILE.\n"), + program_name, program_name, program_name); + + exit (status); +} + /* FIXME: but this won't work with filenames containing blanks. */ /* FIXME: This is provisory. Use strtok. */ @@ -286,8 +320,8 @@ main (argc, argv) else { /* OPENOPTS is a macro. It varies with the system. - Some system make a difference between external and - internal text representation. */ + Some systems distinguish between internal and + external text representations. */ fp = fopen (argv[optind], OPENOPTS); if (fp == NULL) @@ -435,37 +469,3 @@ main (argc, argv) exit (0); } - -static void -usage (status) - int status; -{ - if (status != 0) - fprintf (stderr, _("Try `%s --help' for more information.\n"), - program_name); - else - printf (_("\ -Usage: %s [OPTION] [FILE]...\n\ - or: %s [OPTION] --string=STRING\n\ - or: %s [OPTION] --check [FILE]\n\ -Print or check MD5 checksums.\n\ -With no FILE, or when FILE is -, read standard input.\n\ -\n\ - -h, --help display this help and exit\n\ - -q, --quiet don't show anything, status code shows success\n\ - -v, --verbose verbose output level\n\ - -V, --version output version information and exit\n\ -\n\ - -b, --binary read files in binary mode (default)\n\ - -t, --text read files in text mode\n\ -\n\ - -c, --check check MD5 sums against given list\n\ - -s, --string=STRING compute checksum for STRING\n\ -\n\ -The sums are computed as described in RFC 1321. When checking, the input\n\ -should be a former output of this program. The default mode is to print\n\ -a line with checksum, type, and name for each FILE.\n"), - program_name, program_name, program_name); - - exit (status); -} |