diff --git a/crates/nu-command/src/default_context.rs b/crates/nu-command/src/default_context.rs index 33ab8ee92539..38ea6d317089 100644 --- a/crates/nu-command/src/default_context.rs +++ b/crates/nu-command/src/default_context.rs @@ -361,6 +361,7 @@ pub fn create_default_context(cwd: impl AsRef) -> EngineState { StrDatetimeDeprecated, StrDecimalDeprecated, StrIntDeprecated, + MatchDeprecated, NthDeprecated, UnaliasDeprecated, }; diff --git a/crates/nu-command/src/deprecated/match_.rs b/crates/nu-command/src/deprecated/match_.rs new file mode 100644 index 000000000000..9431f97b08c1 --- /dev/null +++ b/crates/nu-command/src/deprecated/match_.rs @@ -0,0 +1,36 @@ +use nu_protocol::{ + ast::Call, + engine::{Command, EngineState, Stack}, + Category, PipelineData, Signature, +}; + +#[derive(Clone)] +pub struct MatchDeprecated; + +impl Command for MatchDeprecated { + fn name(&self) -> &str { + "match" + } + + fn signature(&self) -> Signature { + Signature::build(self.name()).category(Category::Deprecated) + } + + fn usage(&self) -> &str { + "Deprecated command" + } + + fn run( + &self, + _engine_state: &EngineState, + _stack: &mut Stack, + call: &Call, + _input: PipelineData, + ) -> Result { + Err(nu_protocol::ShellError::DeprecatedCommand( + self.name().to_string(), + "find".to_string(), + call.head, + )) + } +} diff --git a/crates/nu-command/src/deprecated/mod.rs b/crates/nu-command/src/deprecated/mod.rs index abf7759a8d18..09ae1ac3242f 100644 --- a/crates/nu-command/src/deprecated/mod.rs +++ b/crates/nu-command/src/deprecated/mod.rs @@ -1,4 +1,5 @@ mod insert; +mod match_; mod nth; mod pivot; mod str_datetime; @@ -7,6 +8,7 @@ mod str_int; mod unalias; pub use insert::InsertDeprecated; +pub use match_::MatchDeprecated; pub use nth::NthDeprecated; pub use pivot::PivotDeprecated; pub use str_datetime::StrDatetimeDeprecated;