1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-05 19:50:59 +01:00
zsh/Completion/Unix/Command/_bpython
2014-07-26 21:58:11 +02:00

46 lines
1.1 KiB
Bash

#compdef bpython bpython-gtk bpython-urwid
local -a all_opts urwid_opts gtk_opts
all_opts=(
'--config[configuration file]:config file:_files'
'-h --help[show help message]'
'(-i --interactive)'{-i,--interactive}'[drop to bpython after running a file]'
'(-q --quiet)'{-q,--quiet}'[do not flush the output to stdout]'
'(-V --version)'{-V,--version}'[print version]'
'1:script:_files -g "*.u#py(-.)"'
'*:arguments:'
)
urwid_opts=(
'(-r --reactor)'{-r,--reactor}'[use Twisted reactor instead of the event loop]:reactor:'
'--help-reactors[display list of available Twisted reactors]'
'(-p --plugin)'{-p,--plugin}'[exectue a twistd plugin]:plugin:'
'(-s --server)'{-s,--server}'[run an eval server on the given port]:port:'
)
gtk_opts=(
'--socket-id[embed bpython]:socket id:'
)
case "$service" in
bpython)
_arguments \
"$all_opts[@]" && return 0
;;
bpython-urwid)
_arguments \
"$all_opts[@]" \
"$urwid_opts[@]" && return 0
;;
bpython-gtk)
_arguments \
"$all_opts[@]" \
"$gtk_opts[@]" && return 0
;;
esac
# vim:autoindent expandtab shiftwidth=2 tabstop=2 softtabstop=2 filetype=zsh