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.
(add_file_name, main): Likewise.
This commit is contained in:
Jim Meyering committed 2004-06-21 15:02:14 +00:00
1 parent f04e77d364
commit bddcb0eab2
1 file changed
+5 -2
+5 -2
View 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);
}