fix(complete): Only return imidiate child subcommands

This commit is contained in:
Roland Fredenhagen 2023-07-28 19:18:49 +07:00 committed by Ed Page
parent 12e1877627
commit edabdf72b5

View file

@ -270,7 +270,7 @@ fn complete_subcommand(value: &str, cmd: &clap::Command) -> Vec<OsString> {
value
);
let mut scs = crate::generator::utils::all_subcommands(cmd)
let mut scs = crate::generator::utils::subcommands(cmd)
.into_iter()
.filter(|x| x.0.starts_with(value))
.map(|x| OsString::from(&x.0))