Communicates unsupported feature the case where directories are found in globs whether we cp or mv

This commit is contained in:
Andrés N. Robalino 2019-08-14 16:44:23 -05:00
parent 75e3c6f547
commit cbf6eed2d7
2 changed files with 4 additions and 4 deletions

View File

@ -240,8 +240,8 @@ pub fn cp(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream,
if destination.exists() {
if !sources.iter().all(|x| (x.as_ref().unwrap()).is_file()) {
return Err(ShellError::labeled_error(
"Copy aborted (directories found).",
"Copy aborted (directories found).",
"Copy aborted (directories found). Recursive copying in patterns not supported yet (try copying the directory directly)",
"Copy aborted (directories found). Recursive copying in patterns not supported yet (try copying the directory directly)",
args.nth(0).unwrap().span(),
));
}

View File

@ -225,8 +225,8 @@ pub fn mv(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream,
if destination.exists() {
if !sources.iter().all(|x| (x.as_ref().unwrap()).is_file()) {
return Err(ShellError::labeled_error(
"Rename aborted (directories found).",
"Rename aborted (directories found).",
"Rename aborted (directories found). Renaming in patterns not supported yet (try moving the directory directly)",
"Rename aborted (directories found). Renaming in patterns not supported yet (try moving the directory directly)",
args.nth(0).unwrap().span(),
));
}