diff options
author | Ronan Pigott <ronan@rjp.ie> | 2025-02-27 12:01:45 -0700 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2025-02-28 20:54:22 +0100 |
commit | f77e469ad60973f45e1ee178f1d66686d326a75a (patch) | |
tree | 102c83a9cf671145a121aa7c0af96c1b440959bc /Completion/Unix/Command/_python | |
parent | 1818323f451f426f20ca47c50e8fc63824578479 (diff) | |
download | zsh-f77e469ad60973f45e1ee178f1d66686d326a75a.tar.gz zsh-f77e469ad60973f45e1ee178f1d66686d326a75a.zip |
53393: Complete python module arguments
Python modules can behave like commands in their own right. This allows
modules to define _python_module-* functions that are used to complete
module arguments. Also gets the ball rolling by defining completions for
venv, http.server, and json.tool.
Diffstat (limited to 'Completion/Unix/Command/_python')
-rw-r--r-- | Completion/Unix/Command/_python | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python index 6e209a199..a5d46cfd6 100644 --- a/Completion/Unix/Command/_python +++ b/Completion/Unix/Command/_python @@ -56,6 +56,9 @@ case "$state" in if [[ -z "$opt_args[(I)-(c|m)]" ]]; then shift words (( CURRENT-- )) + elif [[ -n "$opt_args[(I)-m]" ]]; then + local ret + _call_function ret _python_module-$opt_args[-m] && return ret fi _normal && return ;; |