mirror of
https://github.com/nushell/nushell.git
synced 2024-11-14 20:44:29 +01:00
feat: add unalias to deprecated command (#4440)
This commit is contained in:
parent
cc171b6ad4
commit
baf6348e66
@ -357,6 +357,7 @@ pub fn create_default_context(cwd: impl AsRef<Path>) -> EngineState {
|
||||
StrDecimalDeprecated,
|
||||
StrIntDeprecated,
|
||||
NthDeprecated,
|
||||
UnaliasDeprecated,
|
||||
};
|
||||
|
||||
#[cfg(feature = "dataframe")]
|
||||
|
@ -3,12 +3,14 @@ mod nth;
|
||||
mod pivot;
|
||||
mod str_decimal;
|
||||
mod str_int;
|
||||
mod unalias;
|
||||
|
||||
pub use insert::InsertDeprecated;
|
||||
pub use nth::NthDeprecated;
|
||||
pub use pivot::PivotDeprecated;
|
||||
pub use str_decimal::StrDecimalDeprecated;
|
||||
pub use str_int::StrIntDeprecated;
|
||||
pub use unalias::UnaliasDeprecated;
|
||||
|
||||
#[cfg(feature = "dataframe")]
|
||||
mod dataframe;
|
||||
|
36
crates/nu-command/src/deprecated/unalias.rs
Normal file
36
crates/nu-command/src/deprecated/unalias.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Category, PipelineData, Signature,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct UnaliasDeprecated;
|
||||
|
||||
impl Command for UnaliasDeprecated {
|
||||
fn name(&self) -> &str {
|
||||
"unalias"
|
||||
}
|
||||
|
||||
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(),
|
||||
"hide".to_string(),
|
||||
call.head,
|
||||
))
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user