mirror of
https://github.com/nushell/nushell.git
synced 2025-04-24 05:08:29 +02: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(
|
.switch(
|
||||||
"verbose",
|
"verbose",
|
||||||
"do copy in verbose mode (default:false)",
|
"show successful copies in addition to failed copies (default:false)",
|
||||||
Some('v'),
|
Some('v'),
|
||||||
)
|
)
|
||||||
// TODO: add back in additional features
|
// TODO: add back in additional features
|
||||||
@ -285,7 +285,11 @@ impl Command for Cp {
|
|||||||
if verbose {
|
if verbose {
|
||||||
Ok(result.into_iter().into_pipeline_data(ctrlc))
|
Ok(result.into_iter().into_pipeline_data(ctrlc))
|
||||||
} else {
|
} 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