summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_python
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@fairlystable.org>2025-04-30 02:07:56 -0700
committerJoe Rayhawk <jrayhawk@fairlystable.org>2025-04-30 02:07:56 -0700
commit26e09889646be3ea65b4a3dfeda26213e4bb6a27 (patch)
tree4f3c73a9416bf47ad7e125383d23cf42879e38d7 /Completion/Unix/Command/_python
parent841bce705a58b04220b1f257abcc00ae71cbdbdc (diff)
parent001cba48ce3b964cf01fb3e2af54b20eacbc9bf5 (diff)
downloadzsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.tar.gz
zsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Unix/Command/_python')
-rw-r--r--Completion/Unix/Command/_python11
1 files changed, 9 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python
index e5bac18bb..a5d46cfd6 100644
--- a/Completion/Unix/Command/_python
+++ b/Completion/Unix/Command/_python
@@ -1,9 +1,9 @@
#compdef -P python[0-9.]#
# Python 2.7
-# Python 3.9
+# Python 3.11
-local curcontext="$curcontext" state state_descr line
+local curcontext="$curcontext" state state_descr line _compskip="$_compskip"
typeset -A opt_args
local -a args
@@ -12,7 +12,11 @@ if _pick_variant python3=Python\ 3 python2 --version; then
'(-bb)-b[issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]'
'(-b)-bb[issue errors about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]'
'--check-hash-based-pycs[configure how Python evaluates up-to-dateness of hash-based .pyc files]:mode:(always default never)'
+ '--help-env[print help about Python environment variables and exit]'
+ '--help-xoptions[print help about implementation-specific -X options and exit]'
+ '--help-all[print complete help information and exit]'
"-I[isolate Python from the user's environment]"
+ '-P[do not prepend a potentially unsafe path to sys.path]'
'-q[do not print version and copyright messages]'
'-X[set implementation-specific option]:option'
)
@@ -52,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
;;