Skip to content

Commit

Permalink
cp: makes --preserve requires =
Browse files Browse the repository at this point in the history
prevents --preserve to eat the next argument when no value is passed.

default value for --preserve is set to mode,ownership,timestamps

before the patch:
cp --preserve foo bar
error: invalid value 'foo' for '--preserve [<ATTR_LIST>...]'
  [possible values: mode, ownership, timestamps, context, link, links, xattr, all]

Signed-off-by: Guillaume Ranquet <[email protected]>
  • Loading branch information
granquet committed Jun 1, 2023
1 parent 0b4a917 commit 19a01fb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ pub fn uu_app() -> Command {
PRESERVABLE_ATTRIBUTES,
))
.num_args(0..)
.require_equals(true)
.default_missing_value("mode,ownership,timestamps")
.value_name("ATTR_LIST")
.overrides_with_all([
options::ARCHIVE,
Expand Down

0 comments on commit 19a01fb

Please sign in to comment.