mirror of
https://github.com/nushell/nushell
synced 2025-01-01 15:58:55 +00:00
substitute idiomatic call flag check
This commit is contained in:
parent
e8e1ead99d
commit
8550f50522
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue