]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: cp --no-clobber: improve documentation
authorPádraig Brady <P@draigBrady.com>
Sun, 17 Dec 2023 14:35:36 +0000 (14:35 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 17 Dec 2023 17:19:11 +0000 (17:19 +0000)
* doc/coreutils.texi (cp invocation): Reference the related --update
option, like we had already done in mv invocation.
* src/cp.c (usage): State clearly what --no-clobber does,
indicating it's protection focused, rather than being update focused.

doc/coreutils.texi
src/cp.c

index 1f8b356d12191be25ca532e1bd4698859365ce34..bf0f424d344419fb72006a5418087ed2ed76fa88 100644 (file)
@@ -9057,6 +9057,8 @@ Do not overwrite an existing file; silently fail instead.
 This option overrides a previous
 @option{-i} option.  This option is mutually exclusive with @option{-b} or
 @option{--backup} option.
+See also the @option{--update=none} option which will
+skip existing files but not fail.
 
 @item -P
 @itemx --no-dereference
index 04a5cbee3896f9ffc6427a88707bfa13c19fba57..3ccc4c4e6030d87dc37a567511610cbe0dd3b1e6 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -192,8 +192,8 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
   -L, --dereference            always follow symbolic links in SOURCE\n\
 "), stdout);
       fputs (_("\
-  -n, --no-clobber             do not overwrite an existing file (overrides a\n\
-                                 -u or previous -i option). See also --update\n\
+  -n, --no-clobber             ensure no existing files overwritten, and fail\n\
+                                 silently instead. See also --update\n\
 "), stdout);
       fputs (_("\
   -P, --no-dereference         never follow symbolic links in SOURCE\n\