mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 14:52:41 +00:00
Merge pull request #5555 from cakebaker/cp_adapt_omitting_dir_msg
cp: improve error msg if -r is not specified
This commit is contained in:
commit
64d47730bc
2 changed files with 4 additions and 2 deletions
|
@ -324,7 +324,7 @@ pub(crate) fn copy_directory(
|
|||
source_in_command_line: bool,
|
||||
) -> CopyResult<()> {
|
||||
if !options.recursive {
|
||||
return Err(format!("omitting directory {}", root.quote()).into());
|
||||
return Err(format!("-r not specified; omitting directory {}", root.quote()).into());
|
||||
}
|
||||
|
||||
// if no-dereference is enabled and this is a symlink, copy it as a file
|
||||
|
|
|
@ -131,7 +131,9 @@ fn test_cp_directory_not_recursive() {
|
|||
.arg(TEST_COPY_TO_FOLDER)
|
||||
.arg(TEST_HELLO_WORLD_DEST)
|
||||
.fails()
|
||||
.stderr_contains("omitting directory");
|
||||
.stderr_is(format!(
|
||||
"cp: -r not specified; omitting directory '{TEST_COPY_TO_FOLDER}'\n"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue