forked from extern/nushell
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:
committed by
GitHub
parent
ef26d539a7
commit
0afe1e4e67
@ -20,7 +20,7 @@ impl Command for Cd {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["cd", "change", "directory", "dir", "folder", "switch"]
|
||||
vec!["change", "directory", "dir", "folder", "switch"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
|
@ -36,7 +36,7 @@ impl Command for Cp {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["cp", "copy", "file", "files"]
|
||||
vec!["copy", "file", "files"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
|
@ -33,7 +33,7 @@ impl Command for Glob {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["glob", "files", "folders", "list", "ls"]
|
||||
vec!["pattern", "files", "folders", "list", "ls"]
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
|
@ -33,15 +33,7 @@ impl Command for Mkdir {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec![
|
||||
"mkdir",
|
||||
"make",
|
||||
"directory",
|
||||
"dir",
|
||||
"folder",
|
||||
"make_dir",
|
||||
"make_dirs",
|
||||
]
|
||||
vec!["directory", "folder", "create", "make_dirs"]
|
||||
}
|
||||
|
||||
fn run(
|
||||
|
@ -31,7 +31,7 @@ impl Command for Mv {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["mv", "move"]
|
||||
vec!["move"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
|
@ -28,7 +28,7 @@ impl Command for Open {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["open", "load", "read", "load_file", "read_file"]
|
||||
vec!["load", "read", "load_file", "read_file"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
|
@ -40,7 +40,7 @@ impl Command for Rm {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["rm", "remove"]
|
||||
vec!["delete", "remove"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
|
@ -25,7 +25,7 @@ impl Command for Touch {
|
||||
}
|
||||
|
||||
fn search_terms(&self) -> Vec<&str> {
|
||||
vec!["touch"]
|
||||
vec!["create", "file"]
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
|
Reference in New Issue
Block a user