1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
use crate::prelude::*; use nu_engine::WholeStreamCommand; use nu_errors::ShellError; use nu_protocol::{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(UntaggedValue::string(get_full_help( &Command, args.scope(), )))) } }