cp: Rename -d option to -P

The -d option is a GNU extension and is equivalent to its "-P
--preserve=links" options.

Since we don't implement the --preserve=links functionality anyway (it
means preserve hard links between files), just call it -P, which is
specified by POSIX.

Additionally, there is no need to check for cp_Pflag again before
copying the symlink itself because the only way the mode in the stat
will indicate a symlink is if we used lstat (which we only do if -P is
specified).
This commit is contained in:
Michael Forney
2014-12-08 03:25:24 +00:00
committed by sin
parent 573ef00c91
commit e14e0becce
4 changed files with 11 additions and 11 deletions

6
cp.1
View File

@@ -8,7 +8,7 @@ cp \- copy files and directories
.RI [ name ]
.P
.B cp
.RB [ \-adpRrv ]
.RB [ \-aPpRrv ]
.RI [ file ...]
.RI [ directory ]
.SH DESCRIPTION
@@ -21,8 +21,8 @@ they will be copied into the given directory.
preserve mode, timestamp, links and permissions.
Implies \-d, \-p, \-r.
.TP
.B \-d
don't dereference links. preserve links.
.B \-P
don't dereference symbolic links.
.TP
.B \-p
preserve mode, timestamp and permissions.