Test command names and search terms for redundancy (#6380)

* Test commands for proper names and search terms

Assert that the `Command.name()` is equal to `Signature.name`

Check that search terms are not just substrings of the command name as
they would not help finding the command.

* Clean up search terms

Remove redundant terms that just replicate the command name.
Try to eliminate substring between search terms, clean up where
necessary.
This commit is contained in:
Stefan Holderbach
2022-08-24 11:16:47 +02:00
committed by GitHub
parent ef26d539a7
commit 0afe1e4e67
68 changed files with 126 additions and 91 deletions

View File

@ -26,7 +26,7 @@ impl Command for SubCommand {
}
fn search_terms(&self) -> Vec<&str> {
vec!["url", "host", "hostname"]
vec!["hostname"]
}
fn run(

View File

@ -25,10 +25,6 @@ impl Command for SubCommand {
"Get the path of a URL"
}
fn search_terms(&self) -> Vec<&str> {
vec!["url", "path"]
}
fn run(
&self,
engine_state: &EngineState,

View File

@ -26,7 +26,7 @@ impl Command for SubCommand {
}
fn search_terms(&self) -> Vec<&str> {
vec!["url", "query", "parameter"]
vec!["parameter"]
}
fn run(

View File

@ -26,7 +26,7 @@ impl Command for SubCommand {
}
fn search_terms(&self) -> Vec<&str> {
vec!["url", "scheme", "protocol"]
vec!["protocol"]
}
fn run(

View File

@ -22,7 +22,7 @@ impl Command for Url {
}
fn search_terms(&self) -> Vec<&str> {
vec!["url", "network", "parse"]
vec!["network", "parse"]
}
fn run(