test(complete): Include a visible command alias

Only zsh includes completion for visible aliases of subcommands. Let's
show that in tests.
This commit is contained in:
Martin von Zweigbergk 2022-09-26 21:18:24 -07:00
parent 5020d739d5
commit 8d0ef124e0
2 changed files with 2 additions and 0 deletions

View file

@ -151,6 +151,7 @@ pub fn sub_subcommands_command(name: &'static str) -> clap::Command {
feature_sample_command(name).subcommand(
clap::Command::new("some_cmd")
.about("top level subcommand")
.visible_alias("some_cmd_alias")
.subcommand(
clap::Command::new("sub_cmd").about("sub-subcommand").arg(
clap::Arg::new("config")

View file

@ -151,6 +151,7 @@ _my-app_commands() {
local commands; commands=(
'test:tests things' \
'some_cmd:top level subcommand' \
'some_cmd_alias:top level subcommand' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app commands' commands "$@"