cp,mv: add --update=none-fail to fail if existing files
commit49912bac286eb3c0ef7d1567ae790193ad5eb2e8
authorPádraig Brady <P@draigBrady.com>
Mon, 5 Feb 2024 15:55:07 +0000 (5 15:55 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 26 Feb 2024 17:33:02 +0000 (26 17:33 +0000)
treea8fbd0bdc61b3a82c194be5fe220e91e39698529
parent9907b6f5dc3faf370c916c2f81bfcc3d06028e83
cp,mv: add --update=none-fail to fail if existing files

* src/cp.c (main): Add support for --update=none-fail to provide the
functionality of diagnosing files in the destination,
and exiting with failure status.
(usage): Mark -n as deprecated.
* src/mv.c: Likewise.
* src/copy.h: Add UPDATE_NONE_FAIL definition.
* src/system.h (emit_update_parameters_note): Add --update=none-fail
description.
* doc/coreutils.texi (cp invocation): Likewise.
Also mention why -n is deprecated.
* tests/mv/update.sh: Add a test case, including precedence
with -n and other --update options.
* tests/cp/cp-i.sh: Verify that --backup and --update=none{,-fail}
are mutually exclusive.
* tests/mv/mv-n.sh: Likewise.
* NEWS: Mention the new feature.
Addresses https://bugs.gnu.org/62572
NEWS
doc/coreutils.texi
src/copy.h
src/cp.c
src/mv.c
src/system.h
tests/cp/cp-i.sh
tests/mv/mv-n.sh
tests/mv/update.sh