mirror of
https://github.com/nushell/nushell.git
synced 2025-01-25 15:51:28 +01:00
Mark match
as deprecated command (#4802)
This commit is contained in:
parent
3bdd924349
commit
643cce8a6f
@ -361,6 +361,7 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
|
|||||||
StrDatetimeDeprecated,
|
StrDatetimeDeprecated,
|
||||||
StrDecimalDeprecated,
|
StrDecimalDeprecated,
|
||||||
StrIntDeprecated,
|
StrIntDeprecated,
|
||||||
|
MatchDeprecated,
|
||||||
NthDeprecated,
|
NthDeprecated,
|
||||||
UnaliasDeprecated,
|
UnaliasDeprecated,
|
||||||
};
|
};
|
||||||
|
36
crates/nu-command/src/deprecated/match_.rs
Normal file
36
crates/nu-command/src/deprecated/match_.rs
Normal file
@ -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<nu_protocol::PipelineData, nu_protocol::ShellError> {
|
||||||
|
Err(nu_protocol::ShellError::DeprecatedCommand(
|
||||||
|
self.name().to_string(),
|
||||||
|
"find".to_string(),
|
||||||
|
call.head,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
mod insert;
|
mod insert;
|
||||||
|
mod match_;
|
||||||
mod nth;
|
mod nth;
|
||||||
mod pivot;
|
mod pivot;
|
||||||
mod str_datetime;
|
mod str_datetime;
|
||||||
@ -7,6 +8,7 @@ mod str_int;
|
|||||||
mod unalias;
|
mod unalias;
|
||||||
|
|
||||||
pub use insert::InsertDeprecated;
|
pub use insert::InsertDeprecated;
|
||||||
|
pub use match_::MatchDeprecated;
|
||||||
pub use nth::NthDeprecated;
|
pub use nth::NthDeprecated;
|
||||||
pub use pivot::PivotDeprecated;
|
pub use pivot::PivotDeprecated;
|
||||||
pub use str_datetime::StrDatetimeDeprecated;
|
pub use str_datetime::StrDatetimeDeprecated;
|
||||||
|
Loading…
Reference in New Issue
Block a user