File tree 1 file changed +10
-2
lines changed 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 5
5
6
6
from shlex import quote
7
7
8
- bashcode = r"""
8
+ bashcode = r"""#compdef %(executables)s
9
9
# Run something, muting output or redirecting it to the debug stream
10
10
# depending on the value of _ARC_DEBUG.
11
11
# If ARGCOMPLETE_USE_TEMPFILES is set, use tempfiles for IPC.
75
75
if [[ -z "${ZSH_VERSION-}" ]]; then
76
76
complete %(complete_opts)s -F _python_argcomplete%(function_suffix)s %(executables)s
77
77
else
78
+ # When called by the Zsh completion system, this will end with
79
+ # "loadautofunc" when initially autoloaded and "shfunc" later on, otherwise,
80
+ # the script was "eval"-ed so use "compdef" to register it with the
81
+ # completion system
78
82
autoload is-at-least
79
- compdef _python_argcomplete%(function_suffix)s %(executables)s
83
+ if [[ $zsh_eval_context == *func ]]; then
84
+ _python_argcomplete%(function_suffix)s "$@"
85
+ else
86
+ compdef _python_argcomplete%(function_suffix)s %(executables)s
87
+ fi
80
88
fi
81
89
"""
82
90
You can’t perform that action at this time.
0 commit comments