mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
Merge pull request #2409 from hbina/hbina-cp-preserve-no-args
Fixed cp --preserve accepting no args
This commit is contained in:
commit
d8d0078dde
2 changed files with 10 additions and 0 deletions
|
@ -396,6 +396,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
|
||||||
.multiple(true)
|
.multiple(true)
|
||||||
.use_delimiter(true)
|
.use_delimiter(true)
|
||||||
.possible_values(PRESERVABLE_ATTRIBUTES)
|
.possible_values(PRESERVABLE_ATTRIBUTES)
|
||||||
|
.min_values(0)
|
||||||
.value_name("ATTR_LIST")
|
.value_name("ATTR_LIST")
|
||||||
.conflicts_with_all(&[OPT_PRESERVE_DEFAULT_ATTRIBUTES, OPT_NO_PRESERVE])
|
.conflicts_with_all(&[OPT_PRESERVE_DEFAULT_ATTRIBUTES, OPT_NO_PRESERVE])
|
||||||
// -d sets this option
|
// -d sets this option
|
||||||
|
|
|
@ -726,6 +726,15 @@ fn test_cp_parents_dest_not_directory() {
|
||||||
.stderr_contains("with --parents, the destination must be a directory");
|
.stderr_contains("with --parents, the destination must be a directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_cp_preserve_no_args() {
|
||||||
|
new_ucmd!()
|
||||||
|
.arg(TEST_COPY_FROM_FOLDER_FILE)
|
||||||
|
.arg(TEST_HELLO_WORLD_DEST)
|
||||||
|
.arg("--preserve")
|
||||||
|
.succeeds();
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
// For now, disable the test on Windows. Symlinks aren't well support on Windows.
|
// For now, disable the test on Windows. Symlinks aren't well support on Windows.
|
||||||
// It works on Unix for now and it works locally when run from a powershell
|
// It works on Unix for now and it works locally when run from a powershell
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue