forked from extern/nushell
Add search terms to many commands (#5096)
This commit is contained in:
parent
fa6ed7a40b
commit
657b631fdc
@ -35,6 +35,10 @@ impl Command for Tutor {
|
||||
"Run the tutorial. To begin, run: tutor"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["help", "learn", "tutorial"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -27,6 +27,10 @@ impl Command for Ls {
|
||||
"List the files in a directory."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["dir"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("ls")
|
||||
// Using a string instead of a glob pattern shape so it won't auto-expand
|
||||
|
@ -25,7 +25,7 @@ impl Command for Append {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["concatenate"]
|
||||
vec!["add", "concatenate"]
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
|
@ -28,6 +28,10 @@ impl Command for DropColumn {
|
||||
"Remove the last number of columns. If you want to remove columns by name, try 'reject'."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["delete"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -29,6 +29,10 @@ impl Command for Drop {
|
||||
"Remove the last number of rows or columns."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["delete"]
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![
|
||||
Example {
|
||||
|
@ -31,6 +31,10 @@ impl Command for DropNth {
|
||||
"Drop the selected rows."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["delete"]
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![
|
||||
Example {
|
||||
|
@ -18,6 +18,10 @@ impl Command for Each {
|
||||
"Run a block on each element of input"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["for", "loop", "iterate"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("each")
|
||||
.required(
|
||||
|
@ -33,6 +33,10 @@ impl Command for Insert {
|
||||
"Insert a new column."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["add"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -29,7 +29,7 @@ impl Command for Prepend {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["concatenate"]
|
||||
vec!["add", "concatenate"]
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
|
@ -44,6 +44,10 @@ impl Command for Transpose {
|
||||
"Transposes the table contents so rows become columns and columns become rows."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["pivot"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -35,6 +35,10 @@ impl Command for Uniq {
|
||||
"Return the unique rows."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["distinct", "deduplicate"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -33,6 +33,10 @@ impl Command for Upsert {
|
||||
"Update an existing column to have a new value, or insert a new column."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["add"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -19,6 +19,10 @@ impl Command for Input {
|
||||
"Get input from the user."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["prompt", "interactive"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("input")
|
||||
.optional("prompt", SyntaxShape::String, "prompt to show the user")
|
||||
|
@ -171,6 +171,10 @@ impl Command for Char {
|
||||
"Output special characters (e.g., 'newline')."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["line break", "newline", "Unicode"]
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![
|
||||
Example {
|
||||
|
@ -27,6 +27,10 @@ impl Command for SubCommand {
|
||||
"downcases text"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["lower case", "lowercase"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -24,6 +24,10 @@ impl Command for SubCommand {
|
||||
"upcases text"
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["uppercase", "upper case"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &EngineState,
|
||||
|
@ -32,6 +32,10 @@ impl Command for Table {
|
||||
"Render the table."
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["display", "render"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("table")
|
||||
.named(
|
||||
|
Loading…
Reference in New Issue
Block a user