mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
cp: allow multiple usages of -R/-r Closes: #5027
works for all other rm args
This commit is contained in:
parent
42bf580f13
commit
e491bbdbed
2 changed files with 15 additions and 0 deletions
|
@ -383,6 +383,7 @@ pub fn uu_app() -> Command {
|
||||||
backup_control::BACKUP_CONTROL_LONG_HELP
|
backup_control::BACKUP_CONTROL_LONG_HELP
|
||||||
))
|
))
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
|
.args_override_self(true)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::TARGET_DIRECTORY)
|
Arg::new(options::TARGET_DIRECTORY)
|
||||||
.short('t')
|
.short('t')
|
||||||
|
|
|
@ -158,6 +158,20 @@ fn test_cp_recurse() {
|
||||||
assert_eq!(at.read(TEST_COPY_TO_FOLDER_NEW_FILE), "Hello, World!\n");
|
assert_eq!(at.read(TEST_COPY_TO_FOLDER_NEW_FILE), "Hello, World!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
fn test_cp_recurse_several() {
|
||||||
|
let (at, mut ucmd) = at_and_ucmd!();
|
||||||
|
ucmd.arg("-r")
|
||||||
|
.arg("-r")
|
||||||
|
.arg(TEST_COPY_FROM_FOLDER)
|
||||||
|
.arg(TEST_COPY_TO_FOLDER_NEW)
|
||||||
|
.succeeds();
|
||||||
|
|
||||||
|
// Check the content of the destination file that was copied.
|
||||||
|
assert_eq!(at.read(TEST_COPY_TO_FOLDER_NEW_FILE), "Hello, World!\n");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_cp_with_dirs_t() {
|
fn test_cp_with_dirs_t() {
|
||||||
let (at, mut ucmd) = at_and_ucmd!();
|
let (at, mut ucmd) = at_and_ucmd!();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue