forked from extern/nushell
Deprecate split-by
command (#14019)
# Description I'm not quite sure what the point of the `split-by` command is. The only example for the command seems to suggest it's an additional grouping command. I.e., a record that seems to be the output of the `group-by` command is passed to `split-by` which then adds an additional layer of grouping based on a different column. # User-Facing Changes Breaking change, deprecated the command.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
use indexmap::IndexMap;
|
||||
use nu_engine::command_prelude::*;
|
||||
use nu_protocol::report_shell_warning;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct SplitBy;
|
||||
@ -27,6 +28,15 @@ impl Command for SplitBy {
|
||||
call: &Call,
|
||||
input: PipelineData,
|
||||
) -> Result<PipelineData, ShellError> {
|
||||
report_shell_warning(
|
||||
engine_state,
|
||||
&ShellError::Deprecated {
|
||||
deprecated: "The `split_by` command",
|
||||
suggestion: "Please use the `group-by` command instead.",
|
||||
span: call.head,
|
||||
help: None,
|
||||
},
|
||||
);
|
||||
split_by(engine_state, stack, call, input)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user