diff options
author | Doug Kearns <dkearns@users.sourceforge.net> | 2004-12-06 12:50:59 +0000 |
---|---|---|
committer | Doug Kearns <dkearns@users.sourceforge.net> | 2004-12-06 12:50:59 +0000 |
commit | 48582a9a60b6d56758117827d36cf9642391e260 (patch) | |
tree | f223f4d9799eac183dfcef6e674f3549e1458e23 | |
parent | 9d9eccad41461e93273cac1d3d3751888e2f2bb8 (diff) | |
download | zsh-48582a9a60b6d56758117827d36cf9642391e260.tar.gz zsh-48582a9a60b6d56758117827d36cf9642391e260.tar.xz zsh-48582a9a60b6d56758117827d36cf9642391e260.zip |
update python completion for version 2.4
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Unix/Command/_python | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 932031b9e..1110e1c2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-12-06 Doug Kearns <djkea2@gus.gscit.monash.edu.au> + + * 20601: Completion/Unix/Command/_python: update python completion for + version 2.4 + 2004-12-01 Wayne Davison <wayned@users.sourceforge.net> * 20595 (modified): Src/compat.c: some style tweaks to zchdir(). diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python index 02697bff4..bb048fc68 100644 --- a/Completion/Unix/Command/_python +++ b/Completion/Unix/Command/_python @@ -1,11 +1,17 @@ #compdef python +# Python 2.4 + +local curcontext="$curcontext" state line +typeset -A opt_args + _arguments -s -S \ '(1 -)-c+[program passed in as string (terminates option list)]:python command:' \ '-d[debug output from parser]' \ '-E[ignore 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' \ '-O[optimize generated bytecode]' \ '-OO[remove doc-strings in addition to the -O optimizations]' \ '-Q+[division options]:division option:(old warn warnall new)' \ @@ -20,4 +26,13 @@ _arguments -s -S \ '(-)1:script file:_files -g "*.py(|c|o)(-.)"' \ '*:script argument:_files' && return +if [[ "$state" = modules ]]; then + 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 +fi + return 1 |