diff options
author | Jim Meyering <meyering@redhat.com> | 2008-10-08 08:51:38 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-12-01 17:03:37 +0100 |
commit | 7ef56a26fd911e551f1bd9d2783afb7fbed6c669 (patch) | |
tree | ef8066ff8bf3e91ca25c94933d3dc6b99a97b142 | |
parent | aa2617b9086ca7ffaf49fd22c0b54ab58c2107fd (diff) | |
download | coreutils-7ef56a26fd911e551f1bd9d2783afb7fbed6c669.tar.xz |
cp, mv: remove 3-year-deprecated+warned-about --reply option
* src/cp.c (reply_args, reply_vals): Remove globals.
[REPLY_OPTION]: Remove enum.
(long_opts) ["reply"]: Remove initializer.
(main): Remove case stmt.
* src/mv.c: Likewise.
Don't include "argmatch.h". No longer used.
* NEWS (Changes in behavior): Mention this.
* tests/Makefile.am (TESTS): Remove mv/reply-no.
* tests/mv/reply-no: Remove file.
* tests/mv/i-link-no: Update, now that --reply= is gone.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/cp.c | 22 | ||||
-rw-r--r-- | src/mv.c | 24 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rwxr-xr-x | tests/mv/i-link-no | 13 | ||||
-rwxr-xr-x | tests/mv/reply-no | 42 |
6 files changed, 9 insertions, 96 deletions
@@ -19,6 +19,9 @@ GNU coreutils NEWS -*- outline -*- ** Changes in behavior + cp and mv: the --reply={yes,no,query} option has been removed. + Using it has elicited a warning for the last three years. + ls -l now marks SELinux-only files with the less obtrusive '.', rather than '+'. A file with any other combination of MAC and ACL is still marked with a '+'. @@ -76,7 +76,6 @@ enum NO_PRESERVE_ATTRIBUTES_OPTION, PARENTS_OPTION, PRESERVE_ATTRIBUTES_OPTION, - REPLY_OPTION, SPARSE_OPTION, STRIP_TRAILING_SLASHES_OPTION, UNLINK_DEST_BEFORE_OPENING @@ -108,18 +107,6 @@ static enum Sparse_type const sparse_type[] = }; ARGMATCH_VERIFY (sparse_type_string, sparse_type); -/* Valid arguments to the `--reply' option. */ -static char const* const reply_args[] = -{ - "yes", "no", "query", NULL -}; -/* The values that correspond to the above strings. */ -static int const reply_vals[] = -{ - I_ALWAYS_YES, I_ALWAYS_NO, I_ASK_USER -}; -ARGMATCH_VERIFY (reply_args, reply_vals); - static struct option const long_opts[] = { {"archive", no_argument, NULL, 'a'}, @@ -138,8 +125,6 @@ static struct option const long_opts[] = {"preserve", optional_argument, NULL, PRESERVE_ATTRIBUTES_OPTION}, {"recursive", no_argument, NULL, 'R'}, {"remove-destination", no_argument, NULL, UNLINK_DEST_BEFORE_OPENING}, - {"reply", required_argument, NULL, REPLY_OPTION}, /* Deprecated 2005-07-03, - remove in 2008. */ {"sparse", required_argument, NULL, SPARSE_OPTION}, {"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION}, {"suffix", required_argument, NULL, 'S'}, @@ -1001,13 +986,6 @@ main (int argc, char **argv) x.recursive = true; break; - case REPLY_OPTION: /* Deprecated */ - x.interactive = XARGMATCH ("--reply", optarg, - reply_args, reply_vals); - error (0, 0, - _("the --reply option is deprecated; use -i or -f instead")); - break; - case UNLINK_DEST_BEFORE_OPENING: x.unlink_dest_before_opening = true; break; @@ -24,7 +24,6 @@ #include <selinux/selinux.h> #include "system.h" -#include "argmatch.h" #include "backupfile.h" #include "copy.h" #include "cp-hash.h" @@ -52,33 +51,18 @@ non-character as a pseudo short option, starting with CHAR_MAX + 1. */ enum { - REPLY_OPTION = CHAR_MAX + 1, - STRIP_TRAILING_SLASHES_OPTION + STRIP_TRAILING_SLASHES_OPTION = CHAR_MAX + 1 }; /* Remove any trailing slashes from each SOURCE argument. */ static bool remove_trailing_slashes; -/* Valid arguments to the `--reply' option. */ -static char const* const reply_args[] = -{ - "yes", "no", "query", NULL -}; - -/* The values that correspond to the above strings. */ -static int const reply_vals[] = -{ - I_ALWAYS_YES, I_ALWAYS_NO, I_ASK_USER -}; - static struct option const long_options[] = { {"backup", optional_argument, NULL, 'b'}, {"force", no_argument, NULL, 'f'}, {"interactive", no_argument, NULL, 'i'}, {"no-target-directory", no_argument, NULL, 'T'}, - {"reply", required_argument, NULL, REPLY_OPTION}, /* Deprecated 2005-07-03, - remove in 2008. */ {"strip-trailing-slashes", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION}, {"suffix", required_argument, NULL, 'S'}, {"target-directory", required_argument, NULL, 't'}, @@ -390,12 +374,6 @@ main (int argc, char **argv) case 'i': x.interactive = I_ASK_USER; break; - case REPLY_OPTION: /* Deprecated */ - x.interactive = XARGMATCH ("--reply", optarg, - reply_args, reply_vals); - error (0, 0, - _("the --reply option is deprecated; use -i or -f instead")); - break; case STRIP_TRAILING_SLASHES_OPTION: remove_trailing_slashes = true; break; diff --git a/tests/Makefile.am b/tests/Makefile.am index 307e5a8a0..2122ea75a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -386,7 +386,6 @@ TESTS = \ mv/part-symlink \ mv/partition-perm \ mv/perm-1 \ - mv/reply-no \ mv/to-symlink \ mv/trailing-slash \ mv/update \ diff --git a/tests/mv/i-link-no b/tests/mv/i-link-no index 226d5dd17..2a762d6d4 100755 --- a/tests/mv/i-link-no +++ b/tests/mv/i-link-no @@ -29,19 +29,16 @@ ln a/foo a/bar || framework_failure echo FUBAR > b/FUBAR || framework_failure ln b/FUBAR b/bar || framework_failure chmod a-w b/bar || framework_failure +echo n > no || framework_failure fail=0 -mv --reply=no a/bar a/foo b > out 2> err || fail=1 -cat <<EOF > exp -EOF +mv a/bar a/foo b < no > out 2> err || fail=1 +touch exp +touch exp_err -cat <<EOF > exp_err -mv: the --reply option is deprecated; use -i or -f instead -EOF - -compare err exp_err || fail=1 compare out exp || fail=1 +compare err exp_err || fail=1 case "`cat b/foo`" in foo) ;; diff --git a/tests/mv/reply-no b/tests/mv/reply-no deleted file mode 100755 index fb7cc2f8d..000000000 --- a/tests/mv/reply-no +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# Ensure that `mv --reply=no f1 f2' works. - -# Copyright (C) 2005-2008 Free Software Foundation, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -if test "$VERBOSE" = yes; then - set -x - mv --version -fi - -. $srcdir/test-lib.sh - -touch a b || framework_failure - -fail=0 - -mv --interactive --reply=no a b > out 2>&1 || fail=1 - -# Both files must remain. -test -f a || fail=1 -test -f b || fail=1 - -cat <<EOF > exp_err -mv: the --reply option is deprecated; use -i or -f instead -EOF - -compare out exp_err || fail=1 - -Exit $fail |