mirror of
https://github.com/nushell/nushell.git
synced 2025-03-26 15:26:51 +01:00
29 lines
679 B
Rust
29 lines
679 B
Rust
use nu_protocol::ast::Call;
|
|
use nu_protocol::engine::{Command, EvaluationContext};
|
|
use nu_protocol::{Signature, SyntaxShape, Value};
|
|
|
|
pub struct Use;
|
|
|
|
impl Command for Use {
|
|
fn name(&self) -> &str {
|
|
"use"
|
|
}
|
|
|
|
fn usage(&self) -> &str {
|
|
"Use definitions from a module"
|
|
}
|
|
|
|
fn signature(&self) -> nu_protocol::Signature {
|
|
Signature::build("use").required("module_name", SyntaxShape::String, "module name")
|
|
}
|
|
|
|
fn run(
|
|
&self,
|
|
_context: &EvaluationContext,
|
|
call: &Call,
|
|
_input: Value,
|
|
) -> Result<nu_protocol::Value, nu_protocol::ShellError> {
|
|
Ok(Value::Nothing { span: call.head })
|
|
}
|
|
}
|