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
This commit is contained in:
NotTheDr01ds 2024-08-01 15:21:39 -04:00 committed by GitHub
parent 4157ca711d
commit 168835ecd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<Example> {
vec![
Example {
description: "Generate random chars",
description: "Generate a string with 25 random chars",
example: "random chars",
result: None,
},