Clarify random-int help

This commit is contained in:
NotTheDr01ds 2024-07-31 16:14:39 -04:00
parent 42531e017c
commit f4b2edfdc6

View File

@ -15,7 +15,11 @@ impl Command for SubCommand {
Signature::build("random int")
.input_output_types(vec![(Type::Nothing, Type::Int)])
.allow_variants_without_examples(true)
.optional("range", SyntaxShape::Range, "Range of values.")
.optional(
"range",
SyntaxShape::Range,
"Range of potential values, inclusive of both start and end values.",
)
.category(Category::Random)
}
@ -40,12 +44,12 @@ impl Command for SubCommand {
fn examples(&self) -> Vec<Example> {
vec![
Example {
description: "Generate an unconstrained random integer",
description: "Generate a non-negative random integer",
example: "random int",
result: None,
},
Example {
description: "Generate a random integer less than or equal to 500",
description: "Generate a random integer between 0 (inclusive) and 500 (inclusive)",
example: "random int ..500",
result: None,
},
@ -55,7 +59,7 @@ impl Command for SubCommand {
result: None,
},
Example {
description: "Generate a random integer between 1 and 10",
description: "Generate a random integer between 1 (inclusive) and 10 (inclusive)",
example: "random int 1..10",
result: None,
},