From 168835ecd2a44362b47b6165ec4bc843fe57fddc Mon Sep 17 00:00:00 2001 From: NotTheDr01ds <32344964+NotTheDr01ds@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:21:39 -0400 Subject: [PATCH] `random chars` doc clarifications (#13511) # Description Clarified `random chars` help/doc: * Default string length in absence of a `--length` arg is 25 * Characters are *"uniformly distributed over ASCII letters and numbers: a-z, A-Z and 0-9"* (copied from the [`rand` crate doc](https://docs.rs/rand/latest/rand/distributions/struct.Alphanumeric.html). # User-Facing Changes Help/Doc only --- crates/nu-command/src/random/chars.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/nu-command/src/random/chars.rs b/crates/nu-command/src/random/chars.rs index fe1e6bcdc4..aea27129b9 100644 --- a/crates/nu-command/src/random/chars.rs +++ b/crates/nu-command/src/random/chars.rs @@ -19,12 +19,17 @@ impl Command for SubCommand { Signature::build("random chars") .input_output_types(vec![(Type::Nothing, Type::String)]) .allow_variants_without_examples(true) - .named("length", SyntaxShape::Int, "Number of chars", Some('l')) + .named( + "length", + SyntaxShape::Int, + "Number of chars (default 25)", + Some('l'), + ) .category(Category::Random) } fn usage(&self) -> &str { - "Generate random chars." + "Generate random chars uniformly distributed over ASCII letters and numbers: a-z, A-Z and 0-9." } fn search_terms(&self) -> Vec<&str> { @@ -44,7 +49,7 @@ impl Command for SubCommand { fn examples(&self) -> Vec { vec![ Example { - description: "Generate random chars", + description: "Generate a string with 25 random chars", example: "random chars", result: None, },