#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)
{
*/
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. */
"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" \