diff --git a/crates/nu-command/src/core_commands/tutor.rs b/crates/nu-command/src/core_commands/tutor.rs index a5c585328b..7fc38a5e1b 100644 --- a/crates/nu-command/src/core_commands/tutor.rs +++ b/crates/nu-command/src/core_commands/tutor.rs @@ -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, diff --git a/crates/nu-command/src/filesystem/ls.rs b/crates/nu-command/src/filesystem/ls.rs index 18d32ac43a..7c579ff0cf 100644 --- a/crates/nu-command/src/filesystem/ls.rs +++ b/crates/nu-command/src/filesystem/ls.rs @@ -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 diff --git a/crates/nu-command/src/filters/append.rs b/crates/nu-command/src/filters/append.rs index 51df71afae..2d8f1f7d5a 100644 --- a/crates/nu-command/src/filters/append.rs +++ b/crates/nu-command/src/filters/append.rs @@ -25,7 +25,7 @@ impl Command for Append { } fn search_terms(&self) -> Vec<&str> { - vec!["concatenate"] + vec!["add", "concatenate"] } fn examples(&self) -> Vec { diff --git a/crates/nu-command/src/filters/drop/column.rs b/crates/nu-command/src/filters/drop/column.rs index c8a77e9ddf..9f441c97cd 100644 --- a/crates/nu-command/src/filters/drop/column.rs +++ b/crates/nu-command/src/filters/drop/column.rs @@ -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, diff --git a/crates/nu-command/src/filters/drop/drop_.rs b/crates/nu-command/src/filters/drop/drop_.rs index e16378fd21..98cb4850eb 100644 --- a/crates/nu-command/src/filters/drop/drop_.rs +++ b/crates/nu-command/src/filters/drop/drop_.rs @@ -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 { vec![ Example { diff --git a/crates/nu-command/src/filters/drop/nth.rs b/crates/nu-command/src/filters/drop/nth.rs index e46efa6c3c..06d33fad0a 100644 --- a/crates/nu-command/src/filters/drop/nth.rs +++ b/crates/nu-command/src/filters/drop/nth.rs @@ -31,6 +31,10 @@ impl Command for DropNth { "Drop the selected rows." } + fn search_terms(&self) -> Vec<&str> { + vec!["delete"] + } + fn examples(&self) -> Vec { vec![ Example { diff --git a/crates/nu-command/src/filters/each.rs b/crates/nu-command/src/filters/each.rs index 0f8b3f5186..e4fad2bbaa 100644 --- a/crates/nu-command/src/filters/each.rs +++ b/crates/nu-command/src/filters/each.rs @@ -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( diff --git a/crates/nu-command/src/filters/insert.rs b/crates/nu-command/src/filters/insert.rs index f9cd0b7779..b3c1c46c4b 100644 --- a/crates/nu-command/src/filters/insert.rs +++ b/crates/nu-command/src/filters/insert.rs @@ -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, diff --git a/crates/nu-command/src/filters/prepend.rs b/crates/nu-command/src/filters/prepend.rs index d06cbc2426..22b5986dd2 100644 --- a/crates/nu-command/src/filters/prepend.rs +++ b/crates/nu-command/src/filters/prepend.rs @@ -29,7 +29,7 @@ impl Command for Prepend { } fn search_terms(&self) -> Vec<&str> { - vec!["concatenate"] + vec!["add", "concatenate"] } fn examples(&self) -> Vec { diff --git a/crates/nu-command/src/filters/transpose.rs b/crates/nu-command/src/filters/transpose.rs index b85738f998..afc9f5a66f 100644 --- a/crates/nu-command/src/filters/transpose.rs +++ b/crates/nu-command/src/filters/transpose.rs @@ -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, diff --git a/crates/nu-command/src/filters/uniq.rs b/crates/nu-command/src/filters/uniq.rs index 2985715d50..a165748ef2 100644 --- a/crates/nu-command/src/filters/uniq.rs +++ b/crates/nu-command/src/filters/uniq.rs @@ -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, diff --git a/crates/nu-command/src/filters/upsert.rs b/crates/nu-command/src/filters/upsert.rs index 545a45aabd..beb53aa9e5 100644 --- a/crates/nu-command/src/filters/upsert.rs +++ b/crates/nu-command/src/filters/upsert.rs @@ -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, diff --git a/crates/nu-command/src/platform/input.rs b/crates/nu-command/src/platform/input.rs index a778e7aa16..45ffbf4684 100644 --- a/crates/nu-command/src/platform/input.rs +++ b/crates/nu-command/src/platform/input.rs @@ -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") diff --git a/crates/nu-command/src/strings/char_.rs b/crates/nu-command/src/strings/char_.rs index a7e0458b7c..40ad25400a 100644 --- a/crates/nu-command/src/strings/char_.rs +++ b/crates/nu-command/src/strings/char_.rs @@ -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 { vec![ Example { diff --git a/crates/nu-command/src/strings/str_/downcase.rs b/crates/nu-command/src/strings/str_/downcase.rs index d048d8c814..38b6670bba 100644 --- a/crates/nu-command/src/strings/str_/downcase.rs +++ b/crates/nu-command/src/strings/str_/downcase.rs @@ -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, diff --git a/crates/nu-command/src/strings/str_/upcase.rs b/crates/nu-command/src/strings/str_/upcase.rs index 94f8a58dcb..f7945c3708 100644 --- a/crates/nu-command/src/strings/str_/upcase.rs +++ b/crates/nu-command/src/strings/str_/upcase.rs @@ -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, diff --git a/crates/nu-command/src/viewers/table.rs b/crates/nu-command/src/viewers/table.rs index 90d6eba40e..2dfb007fe4 100644 --- a/crates/nu-command/src/viewers/table.rs +++ b/crates/nu-command/src/viewers/table.rs @@ -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(