From: Jim Meyering Date: Mon, 21 Jun 2004 15:02:28 +0000 (+0000) Subject: Standardize on the diagnostics given when someone gives X-Git-Tag: COREUTILS-5_3_0~1288 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=110be46897450cd5fa90e3a955ab9092db128cea;p=platform%2Fupstream%2Fcoreutils.git 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. --- diff --git a/src/cp.c b/src/cp.c index 4f2f1b0..3bcdd0a 100644 --- a/src/cp.c +++ b/src/cp.c @@ -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); }