mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
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:
1 parent
f04e77d364
commit
bddcb0eab2
1 file changed
+5
-2
+5
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user