Package: zsh Version: 4.3.2-8 Severity: wishlist Tags: patch Howdy,
Please add this completion function to the package, and if possible, send it upstream. It should go into Unix/ Micah -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.16-1-vserver-686 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Versions of packages zsh depends on: ii debconf [debconf-2.0] 1.5.0 Debian configuration management sy ii libc6 2.3.6-7 GNU C Library: Shared libraries ii libncurses5 5.5-1.1 Shared libraries for terminal hand Versions of packages zsh recommends: ii libcap1 1:1.10-14 support for getting/setting POSIX. ii libpcre3 6.4-1.1 Perl 5 Compatible Regular Expressi -- no debconf information
#compdef vserver # Copyright (C) 2005 [EMAIL PROTECTED] - property is theft ! # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ,---- # | NOTES # `---- # # - SVN version: $Id$ # - $URL$ # - Tested on Debian GNU/Linux with util-vserver 0.30.209. # # ,---- # | TODO # `---- # - Use util-vserver shell functions library, as does the Bash # completion script found on /usr/lib/util-vserver/functions # - Implement commands arguments completion. # ### ### Main completion function ### _vserver () { # local variables local curcontext="$curcontext" state line expl ret=1 local cmd=$words[3] # dispatch case "$cmd" in apt-cache|apt-config|apt-get) compset -n 3 _dispatch $cmd:t $cmd $cmd:t -default- && ret=0 ;; exec) _arguments -C \ '1: :->vsnames' \ '2: :->cmds' \ '3:command name: _command_names -e' \ '*::arguments: _normal' && ret=0 ;; stop|restart|condrestart|enter|running|status) _arguments -C \ '1: :->vsnames' \ '2: :->cmds' \ '*::arguments: _message "no more arguments"' && ret=0 ;; *) _arguments -C \ '(-)--help[print help information]' \ '(- *)--version[print client version information]' \ '1: :->vsnames' \ '2: :->cmds' \ '*:: :->args' && ret=0 ;; esac # cache initialization if [[ -n "$state" ]]; then if (( ! $+_cache_vserver_cfgdir )); then typeset -g _cache_vserver_cfgdir_initialized _vserver_cache_cfgdir fi if (( ! $+_cache_vserver_vsnames )); then typeset -g _cache_vserver_vsnames_initialized _vserver_cache_vsnames fi if (( ! $+_cache_vserver_cmds )); then typeset -g _cache_vserver_cmds_initialized _vserver_cache_cmds fi fi case "$state" in vsnames) _wanted commands expl 'vserver name' _vserver_vsnames && ret=0 ;; cmds) _wanted commands expl 'vserver command' _vserver_commands && ret=0 ;; args) local args if $+args; then _arguments "[EMAIL PROTECTED]" && ret=0 else ret=0 fi ;; esac return ret } ### ### Auxiliary completion functions ### (( $+functions[_vserver_commands] )) || _vserver_commands() { compadd "$@" -k _cache_vserver_cmds || compadd "$@" ${(s.:.)_cache_vserver_cmds} } (( $+functions[_svk_list_patches] )) || _vserver_vsnames() { local expl _wanted vserver expl 'vserver name' compadd -S '' [EMAIL PROTECTED] } ### ### Cache functions ### (( $+functions[_vserver_cache_cfgdir] )) || _vserver_cache_cfgdir() { if [[ "$_cache_vserver_cfgdir_initialized" != true ]]; then typeset -ga _cache_vserver_cfgdir _cache_vserver_cfgdir=`vserver-info info SYSINFO | grep '^ *cfg-Directory' | awk '{print $2}'` _cache_vserver_cfgdir_initialized=true fi } (( $+functions[_vserver_cache_vsnames] )) || _vserver_cache_vsnames() { if [[ "$_cache_vserver_vsnames_initialized" != true ]]; then typeset -ga _cache_vserver_vsnames _cache_vserver_vsnames=( $(ls -d $_cache_vserver_cfgdir/*/ | sed -e s,$_cache_vserver_cfgdir,, | tr -d '/') ) _cache_vserver_vsnames_initialized=true fi } (( $+functions[_vserver_cache_cmds] )) || _vserver_cache_cmds() { if [[ "$_cache_vserver_cmds_initialized" != true ]]; then typeset -ga _cache_vserver_cmds _cache_vserver_cmds=( start stop restart condrestart suexec exec enter chkconfig running status build unify pkg apt-get apt-config apt-cache rpm pkgmgmt ) _cache_vserver_cmds_initialized=true fi } ### ### Main function call ### _vserver "$@" ### ### Emacs variables ### # Local Variables: # mode:sh # sh-basic-offset: 2 # End: