mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 12:58:11 +02:00
deprecated commands (#4405)
* deprecated commands * deprecated insert command
This commit is contained in:
36
crates/nu-command/src/deprecated/dataframe.rs
Normal file
36
crates/nu-command/src/deprecated/dataframe.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Category, PipelineData, Signature,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DataframeDeprecated;
|
||||
|
||||
impl Command for DataframeDeprecated {
|
||||
fn name(&self) -> &str {
|
||||
"dataframe"
|
||||
}
|
||||
|
||||
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(),
|
||||
"dfr".to_string(),
|
||||
call.head,
|
||||
))
|
||||
}
|
||||
}
|
36
crates/nu-command/src/deprecated/insert.rs
Normal file
36
crates/nu-command/src/deprecated/insert.rs
Normal file
@ -0,0 +1,36 @@
|
||||
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,
|
||||
))
|
||||
}
|
||||
}
|
17
crates/nu-command/src/deprecated/mod.rs
Normal file
17
crates/nu-command/src/deprecated/mod.rs
Normal file
@ -0,0 +1,17 @@
|
||||
mod insert;
|
||||
mod nth;
|
||||
mod pivot;
|
||||
mod str_decimal;
|
||||
mod str_int;
|
||||
|
||||
pub use insert::InsertDeprecated;
|
||||
pub use nth::NthDeprecated;
|
||||
pub use pivot::PivotDeprecated;
|
||||
pub use str_decimal::StrDecimalDeprecated;
|
||||
pub use str_int::StrIntDeprecated;
|
||||
|
||||
#[cfg(feature = "dataframe")]
|
||||
mod dataframe;
|
||||
|
||||
#[cfg(feature = "dataframe")]
|
||||
pub use dataframe::DataframeDeprecated;
|
36
crates/nu-command/src/deprecated/nth.rs
Normal file
36
crates/nu-command/src/deprecated/nth.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Category, PipelineData, Signature,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct NthDeprecated;
|
||||
|
||||
impl Command for NthDeprecated {
|
||||
fn name(&self) -> &str {
|
||||
"nth"
|
||||
}
|
||||
|
||||
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(),
|
||||
"select".to_string(),
|
||||
call.head,
|
||||
))
|
||||
}
|
||||
}
|
36
crates/nu-command/src/deprecated/pivot.rs
Normal file
36
crates/nu-command/src/deprecated/pivot.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Category, PipelineData, Signature,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct PivotDeprecated;
|
||||
|
||||
impl Command for PivotDeprecated {
|
||||
fn name(&self) -> &str {
|
||||
"pivot"
|
||||
}
|
||||
|
||||
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(),
|
||||
"transpose".to_string(),
|
||||
call.head,
|
||||
))
|
||||
}
|
||||
}
|
36
crates/nu-command/src/deprecated/str_decimal.rs
Normal file
36
crates/nu-command/src/deprecated/str_decimal.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Category, PipelineData, Signature,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct StrDecimalDeprecated;
|
||||
|
||||
impl Command for StrDecimalDeprecated {
|
||||
fn name(&self) -> &str {
|
||||
"str to-decimal"
|
||||
}
|
||||
|
||||
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(),
|
||||
"into decimal".to_string(),
|
||||
call.head,
|
||||
))
|
||||
}
|
||||
}
|
36
crates/nu-command/src/deprecated/str_int.rs
Normal file
36
crates/nu-command/src/deprecated/str_int.rs
Normal file
@ -0,0 +1,36 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Category, PipelineData, Signature,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct StrIntDeprecated;
|
||||
|
||||
impl Command for StrIntDeprecated {
|
||||
fn name(&self) -> &str {
|
||||
"str to-int"
|
||||
}
|
||||
|
||||
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(),
|
||||
"into int".to_string(),
|
||||
call.head,
|
||||
))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user