From af6e1cb5a67640fc7b46703c98bdd9aa4c7d43b6 Mon Sep 17 00:00:00 2001 From: NotTheDr01ds <32344964+NotTheDr01ds@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:55:17 -0400 Subject: [PATCH] Added search terms to `if` (#13145) # Description In this PR, I continue my tradition of trivial but hopefully helpful `help` tweaks. As mentioned in #13143, I noticed that `help -f else` oddly didn't return the `if` statement itself. Perhaps not so oddly, since who the heck is going to go looking for *"else"* in the help? Well, I did ... Added *"else"* and *"conditional"* to the search terms for `if`. I'll work on the meat of #13143 next - That's more substantiative. # User-Facing Changes Help only # Tests + Formatting - :green_circle: `toolkit fmt` - :green_circle: `toolkit clippy` - :green_circle: `toolkit test` - :green_circle: `toolkit test stdlib` - # After Submitting --- crates/nu-cmd-lang/src/core_commands/if_.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/nu-cmd-lang/src/core_commands/if_.rs b/crates/nu-cmd-lang/src/core_commands/if_.rs index 83808c8e06..a2071530ac 100644 --- a/crates/nu-cmd-lang/src/core_commands/if_.rs +++ b/crates/nu-cmd-lang/src/core_commands/if_.rs @@ -122,6 +122,10 @@ impl Command for If { } } + fn search_terms(&self) -> Vec<&str> { + vec!["else", "conditional"] + } + fn examples(&self) -> Vec { vec![ Example {