mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07: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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user