From ac3d12a1a76ce015c0b07b096e3d7da4c2edc9c4 Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Sun, 19 Mar 2023 21:49:57 -0700 Subject: [PATCH] Fix zsh autoload issues --- argcomplete/bash_completion.d/python-argcomplete | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/argcomplete/bash_completion.d/python-argcomplete b/argcomplete/bash_completion.d/python-argcomplete index 74c8a1c7..ddf309fe 100644 --- a/argcomplete/bash_completion.d/python-argcomplete +++ b/argcomplete/bash_completion.d/python-argcomplete @@ -1,3 +1,5 @@ +#compdef -P * + # Copyright 2012-2023, Andrey Kislyuk and argcomplete contributors. # Licensed under the Apache License. See https://github.com/kislyuk/argcomplete for more info. @@ -66,7 +68,7 @@ _python_argcomplete_global() { local executable=$1 __python_argcomplete_expand_tilde_by_ref executable else - if [[ "$service" != "-default-" ]]; then + if [[ "$service" == "-default-" ]]; then return fi local executable=${words[1]} @@ -136,7 +138,7 @@ _python_argcomplete_global() { fi } if [[ -z "${ZSH_VERSION-}" ]]; then - complete -o default -o bashdefault -D -F _python_argcomplete_global + complete -o default -o bashdefault -D -F _python_argcomplete_global else - compdef _python_argcomplete_global -P '*' -N + compdef _python_argcomplete_global -P '*' fi