src/cli/command.rs: improve get_help_completion
This commit is contained in:
parent
d69fcf3080
commit
309e449db2
|
@ -242,13 +242,11 @@ pub fn get_help_completion(
|
|||
}
|
||||
|
||||
let first = &args[0];
|
||||
|
||||
if first.starts_with("-") {
|
||||
return get_simple_completion(help_cmd, &mut done, help_cmd.arg_param, &[], args);
|
||||
}
|
||||
|
||||
if let Some(sub_cmd) = map.commands.get(first) {
|
||||
return get_help_completion(sub_cmd, help_cmd, &args[1..]);
|
||||
if args.len() > 1 {
|
||||
if let Some(sub_cmd) = map.commands.get(first) { // do exact match here
|
||||
return get_help_completion(sub_cmd, help_cmd, &args[1..]);
|
||||
}
|
||||
return Vec::new();
|
||||
}
|
||||
|
||||
let mut completions = Vec::new();
|
||||
|
|
Loading…
Reference in New Issue