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];
|
let first = &args[0];
|
||||||
|
if args.len() > 1 {
|
||||||
if first.starts_with("-") {
|
if let Some(sub_cmd) = map.commands.get(first) { // do exact match here
|
||||||
return get_simple_completion(help_cmd, &mut done, help_cmd.arg_param, &[], args);
|
return get_help_completion(sub_cmd, help_cmd, &args[1..]);
|
||||||
}
|
}
|
||||||
|
return Vec::new();
|
||||||
if let Some(sub_cmd) = map.commands.get(first) {
|
|
||||||
return get_help_completion(sub_cmd, help_cmd, &args[1..]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut completions = Vec::new();
|
let mut completions = Vec::new();
|
||||||
|
|
Loading…
Reference in New Issue