diff options
author | Jim Meyering <jim@meyering.net> | 2004-06-21 15:02:28 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-06-21 15:02:28 +0000 |
commit | 110be46897450cd5fa90e3a955ab9092db128cea (patch) | |
tree | 82e927df0bedc5b759b868d8cd6ce77aba9d2437 /src | |
parent | bddcb0eab2b264292a55c2c9bea6515df70b51d8 (diff) | |
download | coreutils-110be46897450cd5fa90e3a955ab9092db128cea.tar.xz |
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.
(do_copy): Likewise.
Diffstat (limited to 'src')
-rw-r--r-- | src/cp.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -478,14 +478,13 @@ do_copy (int n_files, char **file, const char *target_directory, int ret = 0; int dest_is_dir = 0; - if (n_files <= 0) + if (n_files <= !target_directory) { - error (0, 0, _("missing file argument")); - usage (EXIT_FAILURE); - } - if (n_files == 1 && !target_directory) - { - error (0, 0, _("missing destination file")); + if (n_files == 0) + error (0, 0, _("missing file operand")); + else + error (0, 0, _("missing destination file operand after %s"), + quote (file[0])); usage (EXIT_FAILURE); } |