src/cli/command.rs: improve completions
This commit is contained in:
parent
4ba7b6099c
commit
f4e4d58327
@ -544,10 +544,12 @@ fn print_nested_completion(def: &CommandLineInterface, args: &[String]) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let first = &args[0];
|
let first = &args[0];
|
||||||
|
if args.len() > 1 {
|
||||||
if let Some(sub_cmd) = map.commands.get(first) {
|
if let Some(sub_cmd) = map.commands.get(first) {
|
||||||
print_nested_completion(sub_cmd, &args[1..]);
|
print_nested_completion(sub_cmd, &args[1..]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for cmd in map.commands.keys() {
|
for cmd in map.commands.keys() {
|
||||||
if cmd.starts_with(first) {
|
if cmd.starts_with(first) {
|
||||||
println!("{}", cmd);
|
println!("{}", cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user