diff options
author | Jim Meyering <jim@meyering.net> | 2004-06-21 15:03:35 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-06-21 15:03:35 +0000 |
commit | 1ce7b61d0ea270b0c463198afca1cd0e214192fb (patch) | |
tree | 947f954d8a82091744d3809da651319e9d82001d /src/md5sum.c | |
parent | 110be46897450cd5fa90e3a955ab9092db128cea (diff) | |
download | coreutils-1ce7b61d0ea270b0c463198afca1cd0e214192fb.tar.xz |
(main): Standardize on the diagnostics given when someone gives
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
Diffstat (limited to 'src/md5sum.c')
-rw-r--r-- | src/md5sum.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/md5sum.c b/src/md5sum.c index d37a06def..da4a7caf5 100644 --- a/src/md5sum.c +++ b/src/md5sum.c @@ -30,6 +30,7 @@ #include "checksum.h" #include "getline.h" #include "error.h" +#include "quote.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME (algorithm == ALG_MD5 ? "md5sum" : "sha1sum") @@ -644,7 +645,9 @@ verifying checksums")); if (optind < argc) { - error (0, 0, _("no files may be specified when using --string")); + error (0, 0, _("extra operand %s"), quote (argv[optind])); + fprintf (stderr, "%s\n", + _("File operands cannot be combined with --string.")); usage (EXIT_FAILURE); } for (i = 0; i < n_strings; ++i) @@ -665,8 +668,9 @@ verifying checksums")); { if (optind + 1 < argc) { - error (0, 0, - _("only one argument may be specified when using --check")); + error (0, 0, _("extra operand %s"), quote (argv[optind + 1])); + fprintf (stderr, "%s\n", + _("Only one operand may be specified when using --check.")); usage (EXIT_FAILURE); } |