From: Jim Meyering Date: Sun, 14 Oct 2001 20:54:44 +0000 (+0000) Subject: Now, -P is the same as --no-dereference, per POSIX. X-Git-Tag: FILEUTILS-4_1_1~120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af51884dacad9b0b99271d0a429dc600cc177b72;p=platform%2Fupstream%2Fcoreutils.git Now, -P is the same as --no-dereference, per POSIX. Use --parents to get the old meaning. (enum) [NO_DEREFERENCE_OPTION]: Remove member. (long_opts): Associate --no-dereference with `-P'. (usage): Update description of -P. (main): Remove local, used_P_option, and code to warn that the meaning of -P would be changing. --- diff --git a/src/cp.c b/src/cp.c index 883e72f..4d0d73f 100644 --- a/src/cp.c +++ b/src/cp.c @@ -70,8 +70,7 @@ struct dir_attr non-character as a pseudo short option, starting with CHAR_MAX + 1. */ enum { - NO_DEREFERENCE_OPTION = CHAR_MAX + 1, - NO_PRESERVE_ATTRIBUTES_OPTION, + NO_PRESERVE_ATTRIBUTES_OPTION = CHAR_MAX + 1, PARENTS_OPTION, PRESERVE_ATTRIBUTES_OPTION, REPLY_OPTION, @@ -130,7 +129,7 @@ static struct option const long_opts[] = {"force", no_argument, NULL, 'f'}, {"interactive", no_argument, NULL, 'i'}, {"link", no_argument, NULL, 'l'}, - {"no-dereference", no_argument, NULL, NO_DEREFERENCE_OPTION}, + {"no-dereference", no_argument, NULL, 'P'}, {"no-preserve", required_argument, NULL, NO_PRESERVE_ATTRIBUTES_OPTION}, {"one-file-system", no_argument, NULL, 'x'}, {"parents", no_argument, NULL, PARENTS_OPTION}, @@ -188,8 +187,7 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\ additional attributes: links, all\n\ --no-preserve=ATTR_LIST don't preserve the specified attributes\n\ --parents append source path to DIRECTORY\n\ - -P same as `--parents' for now; soon to change to\n\ - `--no-dereference' to conform to POSIX\n\ + -P same as `--no-dereference'\n\ -r copy recursively, non-directories as files\n\ WARNING: use -R instead when you might copy\n\ special files like FIFOs or /dev/zero\n\ @@ -814,7 +812,6 @@ main (int argc, char **argv) char *version_control_string = NULL; struct cp_options x; char *target_directory = NULL; - int used_P_option = 0; program_name = argv[0]; setlocale (LC_ALL, ""); @@ -891,7 +888,7 @@ main (int argc, char **argv) x.dereference = DEREF_ALWAYS; break; - case NO_DEREFERENCE_OPTION: + case 'P': x.dereference = DEREF_NEVER; break; @@ -918,9 +915,6 @@ main (int argc, char **argv) x.require_preserve = 1; break; - case 'P': - used_P_option = 1; - /* fall through */ case PARENTS_OPTION: flag_path = 1; break; @@ -992,14 +986,6 @@ main (int argc, char **argv) usage (1); } - if (used_P_option) - { - error (0, 0, - _("\ -Warning: the meaning of `-P' will change in the future to conform to POSIX.\n\ -Use `--parents' for the old meaning, and `--no-dereference' for the new one.")); - } - if (backup_suffix_string) simple_backup_suffix = xstrdup (backup_suffix_string);