about summary refs log tree commit diff
path: root/Completion/Unix/Command/_pydoc
blob: f85ab0c2dcfd5c5b363e88fc10176c02ba8f3d41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#compdef pydoc

local context state line ret=1
typeset -A opt_args

_arguments \
  '(-)-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

[[ -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