diff --git a/crates/nu-command/src/filters/split_by.rs b/crates/nu-command/src/filters/split_by.rs index 217918cf91903..b42f0c820c62c 100644 --- a/crates/nu-command/src/filters/split_by.rs +++ b/crates/nu-command/src/filters/split_by.rs @@ -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 { + 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) } diff --git a/crates/nu-protocol/src/errors/shell_error.rs b/crates/nu-protocol/src/errors/shell_error.rs index 96678daef557c..b4b6c29cee050 100644 --- a/crates/nu-protocol/src/errors/shell_error.rs +++ b/crates/nu-protocol/src/errors/shell_error.rs @@ -1330,14 +1330,15 @@ This is an internal Nushell error, please file an issue https://github.com/nushe span: Span, }, - #[error("Deprecated: {old_command}")] - #[diagnostic(help("for more info see {url}"))] + #[error("{deprecated} is deprecated and will be removed in a future release")] + #[diagnostic()] Deprecated { - old_command: String, - new_suggestion: String, - #[label("`{old_command}` is deprecated and will be removed in a future release. Please {new_suggestion} instead.")] + deprecated: &'static str, + suggestion: &'static str, + #[label("{deprecated} is deprecated. {suggestion}")] span: Span, - url: String, + #[help] + help: Option<&'static str>, }, /// Invalid glob pattern