diff --git a/clap_complete/src/dynamic/completer.rs b/clap_complete/src/dynamic/completer.rs index afe4fbf0a214..327e557e14cc 100644 --- a/clap_complete/src/dynamic/completer.rs +++ b/clap_complete/src/dynamic/completer.rs @@ -275,7 +275,7 @@ fn complete_subcommand(value: &str, cmd: &clap::Command) -> Vec { 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)) diff --git a/clap_complete/tests/testsuite/fish.rs b/clap_complete/tests/testsuite/fish.rs index 38764294ea95..47ea7ab648e1 100644 --- a/clap_complete/tests/testsuite/fish.rs +++ b/clap_complete/tests/testsuite/fish.rs @@ -170,10 +170,9 @@ fn complete_dynamic() { let input = "test-dynamic \t"; let expected = r#"% test-dynamic -action cmd-brackets complete one value --help -alias cmd-double-quotes help pacman -h --version -cmd-backslash cmd-expansions hint quote -V -cmd-backticks cmd-single-quotes last two --global"#; +action help pacman -h --help +alias hint quote -V --version +complete last value --global"#; let actual = runtime.complete(input, &term).unwrap(); snapbox::assert_eq(expected, actual); }