Fix for search terms in help --find (#5081)

* Fix search terms in help --find

* Update help --find description
This commit is contained in:
Reilly Wood 2022-04-03 15:37:22 -07:00 committed by GitHub
parent d6dd4078b1
commit 20be8a4987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ impl Command for Help {
.named(
"find",
SyntaxShape::String,
"string to find in command usage",
"string to find in command names, usage, and search terms",
Some('f'),
)
.category(Category::Core)
@ -70,7 +70,7 @@ impl Command for Help {
result: None,
},
Example {
description: "search for string in command usage",
description: "search for string in command names, usage and search terms",
example: "help --find char",
result: None,
},
@ -103,7 +103,7 @@ fn help(
let key = sig.name;
let usage = sig.usage;
let search_terms = sig.search_terms;
let matches_term = if search_terms.is_empty() {
let matches_term = if !search_terms.is_empty() {
search_terms
.iter()
.any(|term| term.to_lowercase().contains(&search_string))