diff options
author | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2015-01-28 23:58:23 +0900 |
---|---|---|
committer | Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> | 2015-01-28 23:58:23 +0900 |
commit | 1faf2888e9617c7bade0a45a4b09648c8da9f6e3 (patch) | |
tree | 827b3ecd583dbf2a111da9c7056f3ca736f2d0b6 /Completion/Unix/Command/_python | |
parent | f591458321362ab0b3d7b383e9343b1d33f98218 (diff) | |
download | zsh-1faf2888e9617c7bade0a45a4b09648c8da9f6e3.tar.gz zsh-1faf2888e9617c7bade0a45a4b09648c8da9f6e3.tar.xz zsh-1faf2888e9617c7bade0a45a4b09648c8da9f6e3.zip |
34415: cache list of all python modules
Diffstat (limited to 'Completion/Unix/Command/_python')
-rw-r--r-- | Completion/Unix/Command/_python | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python index 8e32bdf55..dedb9ceda 100644 --- a/Completion/Unix/Command/_python +++ b/Completion/Unix/Command/_python @@ -1,11 +1,10 @@ -#compdef python python2 python2.4 python2.5 python2.6 python2.7 python3.0 python3.1 python3.2 python3.3 python3.4 +#compdef -P python[0-9.]# # Python 2.7 # Python 3.4 -local curcontext="$curcontext" state line expl +local curcontext="$curcontext" state state_descr line typeset -A opt_args - local -a args if _pick_variant python3=Python\ 3 python2 --version; then @@ -32,7 +31,7 @@ _arguments -C -s -S "$args[@]" \ '-E[ignore PYTHON* environment variables (such as PYTHONPATH)]' \ '(1 * -)-h[display help information]' \ '-i[inspect interactively after running script]' \ - '(1 -)-m[run library module as a script (terminates option list)]:module:->modules' \ + '(1 -)-m[run library module as a script (terminates option list)]:module:_python_modules' \ '-O[optimize generated bytecode slightly]' \ '-OO[remove doc-strings in addition to the -O optimizations]' \ "-s[don't add user site directory to sys.path]" \ @@ -46,14 +45,6 @@ _arguments -C -s -S "$args[@]" \ '*::script argument:= ->normal' && return case "$state" in - modules) - local -a modules - modules=( - ${${=${(f)"$(_call_program modules $words[1] -c \ - 'from\ pydoc\ import\ help\;\ help\(\"modules\"\)')"}[2,-3]}:#\(package\)} - ) - _wanted modules expl module compadd -a modules && return - ;; normal) if [[ -z "$opt_args[(I)-(c|m)]" ]]; then shift words |