* PATCH: python completion update
@ 2004-12-01 14:35 Doug Kearns
0 siblings, 0 replies; only message in thread
From: Doug Kearns @ 2004-12-01 14:35 UTC (permalink / raw)
To: zsh-workers
This updates _python completion for version 2.4.
Regards,
Doug
Index: Completion/Unix/Command/_python
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_python,v
retrieving revision 1.2
diff -u -r1.2 _python
--- Completion/Unix/Command/_python 21 Jan 2004 13:53:29 -0000 1.2
+++ Completion/Unix/Command/_python 1 Dec 2004 14:33:25 -0000
@@ -1,11 +1,15 @@
#compdef python
+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 +24,13 @@
'(-)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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-12-01 14:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-01 14:35 PATCH: python completion update Doug Kearns
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).