]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: cp: document --keep-directory-symlink in correct location
authorPádraig Brady <P@draigBrady.com>
Tue, 20 Jan 2026 19:11:40 +0000 (19:11 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 21 Jan 2026 13:51:58 +0000 (13:51 +0000)
* src/cp.c (usage): Move to alphabetically in list.
* doc/coreutils.texi (mv invocation): Move description from here ...
(cp invocation): ... to here.

doc/coreutils.texi
src/cp.c

index 261cb69dfc8b2ab5b2d8e518d3903c45dbdcc182..34f1b775fe28e74d69e1b55bbe12e5768304ac7b 100644 (file)
@@ -8835,6 +8835,12 @@ Copy symbolic links as symbolic links rather than copying the files that
 they point to.  This option affects only symbolic links in the source;
 symbolic links in the destination are always followed if possible.
 
+@optItem{cp,--keep-directory-symlink,}
+Follow existing symlinks to directories when copying.
+Use this option only when the destination directory's contents are trusted,
+as an attacker can place symlinks in the destination
+to cause @command{cp} write to arbitrary target directories.
+
 @optItem{cp,-p,}
 @optItemx{cp,--preserve,[=@var{attribute_list}]}
 @cindex file information, preserving, extended attributes, xattr
@@ -10019,12 +10025,6 @@ option is also specified.
 @optItemx{mv,--verbose,}
 Print the name of each file before moving it.
 
-@optItem{mv,--keep-directory-symlink,}
-Follow existing symlinks to directories when copying.
-Use this option only when the destination directory's contents are trusted,
-as an attacker can place symlinks in the destination
-to cause @command{cp} write to arbitrary target directories.
-
 @optStripTrailingSlashes{mv}
 
 @optBackupSuffix{mv}
index 278f7cd3454bef1c163212ea6136c62b9fd3ee8b..fa464f2c401e24fade9df4e1b59e94c3bb36df33 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -225,6 +225,10 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
       oputs (_("\
   -P, --no-dereference\n\
          never follow symbolic links in SOURCE\n\
+"));
+      oputs (_("\
+      --keep-directory-symlink\n\
+         follow existing symlinks to directories\n\
 "));
       oputs (_("\
   -p\n\
@@ -291,10 +295,6 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
       oputs (_("\
   -v, --verbose\n\
          explain what is being done\n\
-"));
-      oputs (_("\
-      --keep-directory-symlink\n\
-         follow existing symlinks to directories\n\
 "));
       oputs (_("\
   -x, --one-file-system\n\