2020-06-25 07:51:09 +02:00
|
|
|
use crate::prelude::*;
|
2021-01-10 03:50:49 +01:00
|
|
|
use nu_engine::WholeStreamCommand;
|
2020-06-25 07:51:09 +02:00
|
|
|
use nu_errors::ShellError;
|
2021-05-10 09:07:57 +02:00
|
|
|
use nu_protocol::{Signature, UntaggedValue};
|
2020-06-25 07:51:09 +02:00
|
|
|
|
|
|
|
pub struct Command;
|
|
|
|
|
|
|
|
impl WholeStreamCommand for Command {
|
|
|
|
fn name(&self) -> &str {
|
|
|
|
"random"
|
|
|
|
}
|
|
|
|
|
|
|
|
fn signature(&self) -> Signature {
|
|
|
|
Signature::build("random")
|
|
|
|
}
|
|
|
|
|
|
|
|
fn usage(&self) -> &str {
|
2021-03-08 00:57:58 +01:00
|
|
|
"Generate random values."
|
2020-06-25 07:51:09 +02:00
|
|
|
}
|
|
|
|
|
2021-05-10 09:07:57 +02:00
|
|
|
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
|
|
|
|
Ok(OutputStream::one(UntaggedValue::string(get_full_help(
|
|
|
|
&Command,
|
|
|
|
args.scope(),
|
2020-06-25 07:51:09 +02:00
|
|
|
))))
|
|
|
|
}
|
|
|
|
}
|