nushell/crates/nu-command/src/deprecated/str_find_replace.rs
2022-04-07 08:41:09 -05:00

37 lines
850 B
Rust

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