Add insert and update back (#4864)

This commit is contained in:
JT
2022-03-18 06:55:02 +13:00
committed by GitHub
parent 6e69d40bb9
commit 0986eefb64
14 changed files with 624 additions and 56 deletions

View File

@ -1,36 +0,0 @@
use nu_protocol::{
ast::Call,
engine::{Command, EngineState, Stack},
Category, PipelineData, Signature,
};
#[derive(Clone)]
pub struct InsertDeprecated;
impl Command for InsertDeprecated {
fn name(&self) -> &str {
"insert"
}
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(),
"update".to_string(),
call.head,
))
}
}

View File

@ -1,4 +1,3 @@
mod insert;
mod match_;
mod nth;
mod pivot;
@ -7,7 +6,6 @@ mod str_decimal;
mod str_int;
mod unalias;
pub use insert::InsertDeprecated;
pub use match_::MatchDeprecated;
pub use nth::NthDeprecated;
pub use pivot::PivotDeprecated;