]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: cp: group related -HLP descriptions
authorPádraig Brady <P@draigBrady.com>
Tue, 20 Jan 2026 19:23:42 +0000 (19:23 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 21 Jan 2026 13:51:58 +0000 (13:51 +0000)
* src/cp (usage): The -HLP options are close
in functionality and close alphabetically, so describe together.
* doc/coreutils.texi (cp invocation): Likewise.

doc/coreutils.texi
src/cp.c

index 34f1b775fe28e74d69e1b55bbe12e5768304ac7b..4a098e24ec4b5af51ddfc5c035cf332cd0f68da2 100644 (file)
@@ -8794,12 +8794,6 @@ This option is independent of the @option{--interactive} or
 This option is ignored when the @option{--no-clobber} or @option{-n} option
 is also used.
 
-@optItem{cp,-H,}
-If a command line argument specifies a symbolic link, then copy the
-file it points to rather than the symbolic link itself.  However,
-copy (preserving its nature) any symbolic link that is encountered
-via recursive traversal.
-
 @optItem{cp,-i,}
 @optItemx{cp,--interactive,}
 When copying a file other than a directory, prompt whether to
@@ -8807,9 +8801,11 @@ overwrite an existing destination file, and fail if the response
 is not affirmative.  The @option{-i} option overrides
 a previous @option{-n} option.
 
-@optItem{cp,-l,}
-@optItemx{cp,--link,}
-Make hard links instead of copies of non-directories.
+@optItem{cp,-H,}
+If a command line argument specifies a symbolic link, then copy the
+file it points to rather than the symbolic link itself.  However,
+copy (preserving its nature) any symbolic link that is encountered
+via recursive traversal.
 
 @optItem{cp,-L,}
 @optItemx{cp,--dereference,}
@@ -8818,16 +8814,6 @@ With this option, @command{cp} cannot create a symbolic link.
 For example, a symlink (to regular file) in the source tree will be copied to
 a regular file in the destination tree.
 
-@optItem{cp,-n,}
-@optItemx{cp,--no-clobber,}
-Do not overwrite an existing file; silently skip instead.
-This option overrides a previous @option{-i} option.
-This option is mutually exclusive with @option{-b} or @option{--backup} option.
-This option is deprecated due to having a different exit status from
-other platforms.  See also the @option{--update} option which will
-give more control over how to deal with existing files in the destination,
-and over the exit status in particular.
-
 @optItem{cp,-P,}
 @optItemx{cp,--no-dereference,}
 @cindex symbolic links, copying
@@ -8841,6 +8827,20 @@ 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,-l,}
+@optItemx{cp,--link,}
+Make hard links instead of copies of non-directories.
+
+@optItem{cp,-n,}
+@optItemx{cp,--no-clobber,}
+Do not overwrite an existing file; silently skip instead.
+This option overrides a previous @option{-i} option.
+This option is mutually exclusive with @option{-b} or @option{--backup} option.
+This option is deprecated due to having a different exit status from
+other platforms.  See also the @option{--update} option which will
+give more control over how to deal with existing files in the destination,
+and over the exit status in particular.
+
 @optItem{cp,-p,}
 @optItemx{cp,--preserve,[=@var{attribute_list}]}
 @cindex file information, preserving, extended attributes, xattr
index fa464f2c401e24fade9df4e1b59e94c3bb36df33..e17484b5d5a1e75259e2f9ae55c4ad436ab1b508 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -209,18 +209,10 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
       oputs (_("\
   -H\n\
          follow command-line symbolic links in SOURCE\n\
-"));
-      oputs (_("\
-  -l, --link\n\
-         hard link files instead of copying\n\
 "));
       oputs (_("\
   -L, --dereference\n\
          always follow symbolic links in SOURCE\n\
-"));
-      oputs (_("\
-  -n, --no-clobber\n\
-         (deprecated) silently skip existing files.  See also --update\n\
 "));
       oputs (_("\
   -P, --no-dereference\n\
@@ -229,6 +221,14 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
       oputs (_("\
       --keep-directory-symlink\n\
          follow existing symlinks to directories\n\
+"));
+      oputs (_("\
+  -l, --link\n\
+         hard link files instead of copying\n\
+"));
+      oputs (_("\
+  -n, --no-clobber\n\
+         (deprecated) silently skip existing files.  See also --update\n\
 "));
       oputs (_("\
   -p\n\