Add search terms in random and expression categories (#7736)

# Description

Refers to: [5093](https://github.com/nushell/nushell/issues/5093)

# Tests

- [x] `cargo fmt --all -- --check` to check standard code formatting
(`cargo fmt --all` applies these changes)
- [x] `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- [x]  `cargo test --workspace` to check that all tests pass
This commit is contained in:
Nupur Agrawal
2023-01-12 18:31:40 +05:30
committed by GitHub
parent 48b7b415e2
commit b004aacd69
16 changed files with 64 additions and 0 deletions

View File

@ -31,6 +31,10 @@ impl Command for SubCommand {
"Generate a random boolean value"
}
fn search_terms(&self) -> Vec<&str> {
vec!["generate", "boolean", "true", "false", "1", "0"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -31,6 +31,10 @@ impl Command for SubCommand {
"Generate random chars"
}
fn search_terms(&self) -> Vec<&str> {
vec!["generate", "character", "symbol", "alphanumeric"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -27,6 +27,10 @@ impl Command for SubCommand {
"Generate a random decimal within a range [min..max]"
}
fn search_terms(&self) -> Vec<&str> {
vec!["generate", "float"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -37,6 +37,10 @@ impl Command for SubCommand {
"Generate a random dice roll"
}
fn search_terms(&self) -> Vec<&str> {
vec!["generate", "die", "1-6"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -27,6 +27,10 @@ impl Command for SubCommand {
"Generate a random integer [min..max]"
}
fn search_terms(&self) -> Vec<&str> {
vec!["generate", "natural", "number"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -22,6 +22,10 @@ impl Command for SubCommand {
"Generate a random uuid4 string"
}
fn search_terms(&self) -> Vec<&str> {
vec!["generate", "uuid4"]
}
fn run(
&self,
_engine_state: &EngineState,