From 5e592fd9b0d0d5a0532ffa57667b3f5e7c09fa92 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 21 Oct 2014 20:53:51 +0200 Subject: 33485: fixes for zstyle context handling --- Completion/Unix/Command/_pydoc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'Completion/Unix/Command/_pydoc') diff --git a/Completion/Unix/Command/_pydoc b/Completion/Unix/Command/_pydoc index 92a01a76f..f85ab0c2d 100644 --- a/Completion/Unix/Command/_pydoc +++ b/Completion/Unix/Command/_pydoc @@ -1,16 +1,19 @@ #compdef pydoc -local context state line +local context state line ret=1 typeset -A opt_args _arguments \ - '-k[keyword]:keyword:' \ - '-p[port]:port:_ports' \ - '-g[gui]' \ - '-w[write out HTML]:file or dir:_files' \ - ':keyword, topic, module, package, or dotted reference:->lookup' && return 0 + '(-)-k[search keyword]:keyword' \ + '(- *)-p[start web server on specified port]:port number' \ + '(- *)-g[start gui]' \ + '(-)-w[write out HTML]:file or dir:_files' \ + '(- *)-h[show help information]' \ + '*: :->lookup' && ret=0 -_alternative \ - 'keywords:keyword:compadd ${=${${(f)"$(pydoc keywords)"}[2,-1]}}' \ - 'topics:topic:compadd ${=${${(f)"$(pydoc topics)"}[2,-1]}}' \ - 'modules:module:' +[[ -n $state ]] && _alternative -C $context \ + 'keywords:keyword:compadd ${=${${(f)"$(_call_program keywords pydoc keywords)"}[2,-1]}}' \ + 'topics:topic:compadd ${=${${(f)"$(_call_program topics pydoc topics)"}[2,-1]}}' \ + 'modules:module:' && ret=0 + +return ret -- cgit 1.4.1