[Pkg-zsh-devel] Bug#691714: zsh: please add completion for bpython

Sebastian Ramacher sebastian at ramacher.at
Sun Oct 28 22:06:52 UTC 2012


Package: zsh
Version: 5.0.0-2
Severity: wishlist
Tags: patch

Please add completion for bpython and its variants. The attached file
implements Completion for bpython, -urwid and -gtk.

Regards

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (650, 'unstable'), (601, 'testing'), (600, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.5-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages zsh depends on:
ii  libc6      2.13-36
ii  libcap2    1:2.22-1.2
ii  libtinfo5  5.9-10

Versions of packages zsh recommends:
ii  libc6         2.13-36
ii  libncursesw5  5.9-10
ii  libpcre3      1:8.31-1

Versions of packages zsh suggests:
ii  zsh-doc  4.3.17-1

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/share/zsh/functions/Completion/Debian/_dpkg (from zsh package)
debsums: changed file /usr/share/zsh/functions/Completion/Debian/_apt (from zsh package)
debsums: changed file /usr/share/zsh/functions/Completion/Unix/_python (from zsh package)

-- 
Sebastian Ramacher
-------------- next part --------------
#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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-zsh-devel/attachments/20121028/f1c273a6/attachment.pgp>


More information about the Pkg-zsh-devel mailing list