diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-01-07 00:56:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-01-07 00:56:47 +0000 |
commit | 6077d90c26b1e102a6bb337c48821313111dc751 (patch) | |
tree | 21b46eb4637ead189d6abdfd9194d0f7543efb0e | |
parent | 1e4dc96d61d1e1309b7117f0304a8ba161666f40 (diff) |
cp: make -P a synonym for -d
-rw-r--r-- | coreutils/cp.c | 8 | ||||
-rw-r--r-- | include/usage.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/coreutils/cp.c b/coreutils/cp.c index 6a82f6bff..97731e83f 100644 --- a/coreutils/cp.c +++ b/coreutils/cp.c @@ -42,7 +42,7 @@ #include "libcoreutils/coreutils.h" /* WARNING!! ORDER IS IMPORTANT!! */ -static const char cp_opts[] = "pdRfiar"; +static const char cp_opts[] = "pdRfiarP"; extern int cp_main(int argc, char **argv) { @@ -73,6 +73,12 @@ extern int cp_main(int argc, char **argv) */ flags |= FILEUTILS_RECUR; } + if (flags & 128) { + /* Make -P a synonym for -d, + * -d is the GNU option while -P is the POSIX 2003 option + */ + flags |= FILEUTILS_DEREFERENCE; + } flags ^= FILEUTILS_DEREFERENCE; /* The sense of this flag was reversed. */ diff --git a/include/usage.h b/include/usage.h index d928a10a3..7cf44d74a 100644 --- a/include/usage.h +++ b/include/usage.h @@ -204,7 +204,7 @@ "Copies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n" \ "\n" \ "\t-a\tSame as -dpR\n" \ - "\t-d\tPreserves links\n" \ + "\t-d,-P\tPreserves links\n" \ "\t-p\tPreserves file attributes if possible\n" \ "\t-f\tforce (implied; ignored) - always set\n" \ "\t-i\tinteractive, prompt before overwrite\n" \ |