mirror of
https://github.com/nushell/nushell.git
synced 2024-12-12 18:20:55 +01:00
073e5727c6
* WIP * WIP * first builds * Tests pass
27 lines
660 B
Rust
27 lines
660 B
Rust
use crate::prelude::*;
|
|
use nu_engine::WholeStreamCommand;
|
|
use nu_errors::ShellError;
|
|
use nu_protocol::{ReturnSuccess, Signature, UntaggedValue};
|
|
|
|
pub struct Command;
|
|
|
|
impl WholeStreamCommand for Command {
|
|
fn name(&self) -> &str {
|
|
"random"
|
|
}
|
|
|
|
fn signature(&self) -> Signature {
|
|
Signature::build("random")
|
|
}
|
|
|
|
fn usage(&self) -> &str {
|
|
"Generate random values."
|
|
}
|
|
|
|
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
|
Ok(OutputStream::one(Ok(ReturnSuccess::Value(
|
|
UntaggedValue::string(get_full_help(&Command, &args.scope)).into_value(Tag::unknown()),
|
|
))))
|
|
}
|
|
}
|