mirror of
https://github.com/nushell/nushell.git
synced 2025-03-04 02:11:25 +01:00
35 lines
801 B
Rust
35 lines
801 B
Rust
|
use nu_protocol::ast::Call;
|
||
|
use nu_protocol::engine::{Command, EngineState, Stack};
|
||
|
use nu_protocol::{Category, PipelineData, ShellError, Signature};
|
||
|
|
||
|
#[derive(Clone)]
|
||
|
pub struct HashBase64;
|
||
|
|
||
|
impl Command for HashBase64 {
|
||
|
fn name(&self) -> &str {
|
||
|
"hash base64"
|
||
|
}
|
||
|
|
||
|
fn signature(&self) -> Signature {
|
||
|
Signature::build(self.name()).category(Category::Deprecated)
|
||
|
}
|
||
|
|
||
|
fn usage(&self) -> &str {
|
||
|
"Deprecated command"
|
||
|
}
|
||
|
|
||
|
fn run(
|
||
|
&self,
|
||
|
_: &EngineState,
|
||
|
_: &mut Stack,
|
||
|
call: &Call,
|
||
|
_: PipelineData,
|
||
|
) -> Result<PipelineData, ShellError> {
|
||
|
Err(nu_protocol::ShellError::DeprecatedCommand(
|
||
|
self.name().to_string(),
|
||
|
"encode base64".to_owned(),
|
||
|
call.head,
|
||
|
))
|
||
|
}
|
||
|
}
|