]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
cp, mv: remove 3-year-deprecated+warned-about --reply option
authorJim Meyering <meyering@redhat.com>
Wed, 8 Oct 2008 06:51:38 +0000 (08:51 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 1 Dec 2008 16:03:37 +0000 (17:03 +0100)
* 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.

NEWS
src/cp.c
src/mv.c
tests/Makefile.am
tests/mv/i-link-no
tests/mv/reply-no [deleted file]

diff --git a/NEWS b/NEWS
index 360cb4b561182df0fb6e4f73213fe1cb352826cb..f0c55500f9186881c23e1d10bb30e263e08d99fc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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 '+'.
index 95eba0cf1c5a46aba7d5d154df2009eafb37a42b..8e349658a172443598f988198e08d63586d71711 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -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;
index fc255f368e7db1689cceb544cdb3a2080c0457ad..98309a412277e3336fe6c30ca067ee53ead638dc 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -24,7 +24,6 @@
 #include <selinux/selinux.h>
 
 #include "system.h"
-#include "argmatch.h"
 #include "backupfile.h"
 #include "copy.h"
 #include "cp-hash.h"
    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;
index 307e5a8a0b169c16ddf095bf08607798fadc6d8c..2122ea75a725abe9fc9720ec44502149c0638205 100644 (file)
@@ -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                                    \
index 226d5dd1766751ee12669fbee11520c8523796cc..2a762d6d4b7e9b07e068d35526762681704e63d1 100755 (executable)
@@ -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 (executable)
index fb7cc2f..0000000
+++ /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