Merge pull request #4734 from XiaoXiaoSN/master

feat(complete): Support to run ZSH completion as a script
This commit is contained in:
Ed Page 2023-02-27 10:17:47 -06:00 committed by GitHub
commit e9535a3618
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 50 additions and 10 deletions

View file

@ -43,7 +43,11 @@ _{name}() {{
{subcommand_details}
_{name} \"$@\"
if [ \"$funcstack[1]\" = \"_{name}\" ]; then
_{name} \"$@\"
else
compdef _{name} {name}
fi
",
name = bin_name,
initial_args = get_args_of(cmd, None),

View file

@ -37,4 +37,8 @@ _my-app_commands() {
_describe -t commands 'my-app commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi

View file

@ -97,4 +97,8 @@ _my-app__test_commands() {
_describe -t commands 'my-app test commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi

View file

@ -104,4 +104,8 @@ _my-app__test_commands() {
_describe -t commands 'my-app test commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi

View file

@ -211,4 +211,8 @@ _my-app__help__help_commands() {
_describe -t commands 'my-app help help commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi

View file

@ -178,4 +178,8 @@ _my-app__test_commands() {
_describe -t commands 'my-app test commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi

View file

@ -224,4 +224,8 @@ _my-app__test_commands() {
_describe -t commands 'my-app test commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi

View file

@ -27,4 +27,8 @@ _my-app_commands() {
_describe -t commands 'my-app commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi

View file

@ -47,4 +47,8 @@ _my-app_commands() {
_describe -t commands 'my-app commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi

View file

@ -27,4 +27,8 @@ _my-app_commands() {
_describe -t commands 'my-app commands' commands "$@"
}
_my-app "$@"
if [ "$funcstack[1]" = "_my-app" ]; then
_my-app "$@"
else
compdef _my-app my-app
fi