From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 887 invoked from network); 8 Aug 2008 21:58:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Aug 2008 21:58:29 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 29744 invoked from network); 8 Aug 2008 21:58:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Aug 2008 21:58:01 -0000 Received: (qmail 5175 invoked by alias); 8 Aug 2008 21:57:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25424 Received: (qmail 5157 invoked from network); 8 Aug 2008 21:57:42 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 8 Aug 2008 21:57:42 -0000 Received: from cork.scru.org (cork.scru.org [209.20.67.2]) by bifrost.dotsrc.org (Postfix) with ESMTPS id C7BA680A6D74 for ; Fri, 8 Aug 2008 23:57:36 +0200 (CEST) Received: by cork.scru.org (Postfix, from userid 1000) id 0D38C104093; Fri, 8 Aug 2008 21:57:34 +0000 (UTC) Date: Fri, 8 Aug 2008 21:57:34 +0000 From: Clint Adams To: zsh-workers@sunsite.dk Cc: Chris Lamb , 490383@bugs.debian.org Subject: Re: Bug#490383: Completion for lintian-info Message-ID: <20080808215734.GA20970@scru.org> Mail-Followup-To: zsh-workers@sunsite.dk, Chris Lamb , 490383@bugs.debian.org References: <20080711225413.01920cc4@sakaki.chris-lamb.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080711225413.01920cc4@sakaki.chris-lamb.co.uk> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.92.1/7984/Fri Aug 8 20:51:24 2008 on bifrost X-Virus-Status: Clean On Fri, Jul 11, 2008 at 10:54:13PM +0100, Chris Lamb wrote: > Attached is a zsh completion script for the lintian-info script. Tweaked just a tad. Index: Completion/Debian/Command/_lintian =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_lintian,v retrieving revision 1.2 diff -u -r1.2 _lintian --- Completion/Debian/Command/_lintian 31 May 2006 17:04:20 -0000 1.2 +++ Completion/Debian/Command/_lintian 8 Aug 2008 21:55:56 -0000 @@ -1,36 +1,65 @@ -#compdef lintian +#compdef lintian lintian-info -_arguments -s \ -'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-S,--setup-lab}'[setup or update the laboratory]' \ -'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-R,--remove-lab}'[remove the laboratory directory]' \ -'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-c,--check}'[run all checks over the specified packages]' \ -'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-C,--check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \ -'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-X,--dont-check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \ -'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-u,--unpack}'[unpack up to unpack level]' \ -'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-r,--remove}'[clean packages up to current unpack level]' \ -'(-h --help)'{-h,--help}'[help]' \ -'(-v --verbose)'{-v,--verbose}'[verbose]' \ -'(-V --version)'{-V,--version}'[version]' \ -'(-d --debug)'{-d,--debug}'[debug]' \ -'--print-version[print unadorned version number]' \ -'(-i --info)'{-i,--info}'[print info about violations]' \ -'(-I --display-info)'{-I,--display-info}'[also display informational tags]' \ -'(-l --unpack-level)'{-l,--unpack-level}'[unpack level]:default unpack level:(0 1 2 none basic contents)' \ -'(-o --no-override)'{-o,--no-override}'[do not use the overrides file]' \ -'--show-overrides[output tags that have been overridden]' \ -'(-U --unpack-info)'{-U,--unpack-info}'[collect informations]:infos:_values -s , "collectibles" changelog-file copyright-file debfiles debian-readme diffstat doc-base-files file-info init.d md5sums menu-files objdump-info override-file scripts source-control-file' \ -'(-m --md5sums)'{-m,--md5sums}'[check md5sums when processing a .changes file]' \ -'--allow-root[override warning when run with superuser privileges]' \ -'--cfg:config file:_files' \ -'--lab:laboratory dir:_files -/' \ -'--archivedir:archive directory:_files -/' \ -'--dist:distribution:(woody sarge sid)' \ -'--section:release:(main contrib non-free)' \ -'--arch:architecture:(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc)' \ -'--root:root directory:_files -/' \ -'(-a --all)'{-a,--all}'[check all packages in the distribution]' \ -'(-b --binary)'{-b,--binary}'[the following packages are binary]' \ -'(-s --source)'{-s,--source}'[the following packages are source]' \ -'--udeb[the following packages are udebs]' \ -'(-p --packages-file)'{-p,--packages-file}'[process packages listed in file]:list:_files' \ -':package:_files -g "*.(changes|deb|dsc)"' +local line cmds ret=1 + +case "$service" in + (lintian) + _arguments -s \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-S,--setup-lab}'[setup or update the laboratory]' \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-R,--remove-lab}'[remove the laboratory directory]' \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-c,--check}'[run all checks over the specified packages]' \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-C,--check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-X,--dont-check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-u,--unpack}'[unpack up to unpack level]' \ + '(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-r,--remove}'[clean packages up to current unpack level]' \ + '(-h --help)'{-h,--help}'[help]' \ + '(-v --verbose)'{-v,--verbose}'[verbose]' \ + '(-V --version)'{-V,--version}'[version]' \ + '(-d --debug)'{-d,--debug}'[debug]' \ + '--print-version[print unadorned version number]' \ + '(-i --info)'{-i,--info}'[print info about violations]' \ + '(-I --display-info)'{-I,--display-info}'[also display informational tags]' \ + '(-l --unpack-level)'{-l,--unpack-level}'[unpack level]:default unpack level:(0 1 2 none basic contents)' \ + '(-o --no-override)'{-o,--no-override}'[do not use the overrides file]' \ + '--show-overrides[output tags that have been overridden]' \ + '(-U --unpack-info)'{-U,--unpack-info}'[collect informations]:infos:_values -s , "collectibles" changelog-file copyright-file debfiles debian-readme diffstat doc-base-files file-info init.d md5sums menu-files objdump-info override-file scripts source-control-file' \ + '(-m --md5sums)'{-m,--md5sums}'[check md5sums when processing a .changes file]' \ + '--allow-root[override warning when run with superuser privileges]' \ + '--cfg:config file:_files' \ + '--lab:laboratory dir:_files -/' \ + '--archivedir:archive directory:_files -/' \ + '--dist:distribution:(woody sarge sid)' \ + '--section:release:(main contrib non-free)' \ + '--arch:architecture:(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc)' \ + '--root:root directory:_files -/' \ + '(-a --all)'{-a,--all}'[check all packages in the distribution]' \ + '(-b --binary)'{-b,--binary}'[the following packages are binary]' \ + '(-s --source)'{-s,--source}'[the following packages are source]' \ + '--udeb[the following packages are udebs]' \ + '(-p --packages-file)'{-p,--packages-file}'[process packages listed in file]:list:_files' \ + ':package:_files -g "*.(changes|deb|dsc)"' + ;; + + (lintian-info) + _arguments -C '1: :->cmds' '*: :->args' && ret=0 + + case $state in + (cmds) + cmds=( + {-t,--tags}':print long description of arguments' + {-a,--annotate}':annotate override entries from stdin' + ) + _describe -t commands 'lintian-info command' cmds && ret=0 + ;; + (args) + case $line[1] in + -t|--tags) + _wanted tag expl 'tag' compadd $(command awk '/^Tag:/ { print $2 }' /usr/share/lintian/checks/*.desc) && ret=0 + ;; + esac + ;; + esac + ;; +esac + +return ret