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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 64 additions and 0 deletions

View File

@ -59,6 +59,10 @@ impl Command for ExprAlias {
}]
}
fn search_terms(&self) -> Vec<&str> {
vec!["aka", "abbr", "otherwise"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -43,6 +43,10 @@ impl Command for ExprArgWhere {
}]
}
fn search_terms(&self) -> Vec<&str> {
vec!["condition", "match", "if"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -37,6 +37,10 @@ impl Command for ExprAsNu {
}]
}
fn search_terms(&self) -> Vec<&str> {
vec!["convert", "conversion"]
}
fn run(
&self,
_engine_state: &EngineState,

View File

@ -43,6 +43,10 @@ impl Command for ExprCol {
}]
}
fn search_terms(&self) -> Vec<&str> {
vec!["create"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -69,6 +69,10 @@ impl Command for ExprConcatStr {
}]
}
fn search_terms(&self) -> Vec<&str> {
vec!["join", "connect", "update"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -65,6 +65,10 @@ impl Command for ExprIsIn {
}]
}
fn search_terms(&self) -> Vec<&str> {
vec!["check", "contained", "is-contain", "match"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -42,6 +42,10 @@ impl Command for ExprLit {
}]
}
fn search_terms(&self) -> Vec<&str> {
vec!["string", "literal", "expression"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -79,6 +79,10 @@ impl Command for ExprOtherwise {
]
}
fn search_terms(&self) -> Vec<&str> {
vec!["condition", "else"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -55,6 +55,10 @@ impl Command for ExprQuantile {
}]
}
fn search_terms(&self) -> Vec<&str> {
vec!["statistics", "percentile", "distribution"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -85,6 +85,10 @@ impl Command for ExprWhen {
]
}
fn search_terms(&self) -> Vec<&str> {
vec!["condition", "match", "if", "else"]
}
fn run(
&self,
engine_state: &EngineState,

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,