mirror of
https://github.com/nushell/nushell.git
synced 2024-11-16 05:23:44 +01:00
substitute idiomatic call flag check
This commit is contained in:
parent
e8e1ead99d
commit
8550f50522
@ -60,7 +60,7 @@ impl Command for Cp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let any_source_is_dir = sources.iter().any(|f| matches!(f, Ok(f) if f.is_dir()));
|
let any_source_is_dir = sources.iter().any(|f| matches!(f, Ok(f) if f.is_dir()));
|
||||||
let recursive = call.named.iter().any(|p| &p.0 == "recursive");
|
let recursive: bool = call.has_flag("recursive");
|
||||||
if any_source_is_dir && !recursive {
|
if any_source_is_dir && !recursive {
|
||||||
return Err(ShellError::MoveNotPossibleSingle(
|
return Err(ShellError::MoveNotPossibleSingle(
|
||||||
"Directories must be copied using \"--recursive\"".to_string(),
|
"Directories must be copied using \"--recursive\"".to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user