]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Standardize on the diagnostics given when someone gives
authorJim Meyering <jim@meyering.net>
Mon, 21 Jun 2004 15:02:14 +0000 (15:02 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 21 Jun 2004 15:02:14 +0000 (15:02 +0000)
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.
(add_file_name, main): Likewise.

src/join.c

index a804e5943c1663bd0e41bf95b87272d3b90f2331..3b2383ebfaef27f909049060db3df6fdda4765b5 100644 (file)
@@ -736,7 +736,7 @@ add_file_name (char const *name, char const *names[2], int *nfiles)
 {
   if (*nfiles == 2)
     {
-      error (0, 0, _("too many non-option arguments"));
+      error (0, 0, _("extra operand %s"), quote (name));
       usage (EXIT_FAILURE);
     }
   names[(*nfiles)++] = name;
@@ -848,7 +848,10 @@ main (int argc, char **argv)
 
   if (nfiles != 2)
     {
-      error (0, 0, _("too few non-option arguments"));
+      if (nfiles == 0)
+       error (0, 0, _("missing operand"));
+      else
+       error (0, 0, _("missing operand after %s"), quote (argv[argc - 1]));
       usage (EXIT_FAILURE);
     }