From 1ce7b61d0ea270b0c463198afca1cd0e214192fb Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 21 Jun 2004 15:03:35 +0000 Subject: (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. --- src/md5sum.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/md5sum.c') 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); } -- cgit v1.2.3-54-g00ecf