nushell/crates/nu-command/src/deprecated/str_decimal.rs
Fernando Herrera 5cf91cb30d
deprecated commands (#4405)
* deprecated commands

* deprecated insert command
2022-02-10 12:55:19 +00:00

37 lines
841 B
Rust

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,
))
}
}