mirror of
https://github.com/nushell/nushell.git
synced 2025-03-24 21:47:56 +01:00
Always report errors in cp
(#6404)
This commit is contained in:
parent
a43514deb2
commit
3f93dc2f1d
@ -50,7 +50,7 @@ impl Command for Cp {
|
||||
)
|
||||
.switch(
|
||||
"verbose",
|
||||
"do copy in verbose mode (default:false)",
|
||||
"show successful copies in addition to failed copies (default:false)",
|
||||
Some('v'),
|
||||
)
|
||||
// TODO: add back in additional features
|
||||
@ -285,7 +285,11 @@ impl Command for Cp {
|
||||
if verbose {
|
||||
Ok(result.into_iter().into_pipeline_data(ctrlc))
|
||||
} else {
|
||||
Ok(PipelineData::new(span))
|
||||
// filter to only errors
|
||||
Ok(result
|
||||
.into_iter()
|
||||
.filter(|v| matches!(v, Value::Error { .. }))
|
||||
.into_pipeline_data(ctrlc))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user