1#compdef lintian lintian-info
2
3local line cmds ret=1
4
5case "$service" in
6   (lintian)
7      _arguments -s \
8      '(-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]' \
9      '(-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]' \
10      '(-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]' \
11      '(-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' \
12      '(-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' \
13      '(-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]' \
14      '(-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]' \
15      '(-h --help)'{-h,--help}'[help]' \
16      '(-v --verbose)'{-v,--verbose}'[verbose]' \
17      '(-V --version)'{-V,--version}'[version]' \
18      '(-d --debug)'{-d,--debug}'[debug]' \
19      '--print-version[print unadorned version number]' \
20      '(-i --info)'{-i,--info}'[print info about violations]' \
21      '(-I --display-info)'{-I,--display-info}'[also display informational tags]' \
22      '(-l --unpack-level)'{-l,--unpack-level}'[unpack level]:default unpack level:(0 1 2 none basic contents)' \
23      '(-o --no-override)'{-o,--no-override}'[do not use the overrides file]' \
24      '--show-overrides[output tags that have been overridden]' \
25      '--color:when:(never always auto)' \
26      '(-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' \
27      '(-m --md5sums)'{-m,--md5sums}'[check md5sums when processing a .changes file]' \
28      '--allow-root[override warning when run with superuser privileges]' \
29      '--cfg:config file:_files' \
30      '--lab:laboratory dir:_files -/' \
31      '--archivedir:archive directory:_files -/' \
32      '--dist:distribution:(woody sarge sid)' \
33      '--section:release:(main contrib non-free)' \
34      '--arch:architecture:(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc)' \
35      '--root:root directory:_files -/' \
36      '(-a --all)'{-a,--all}'[check all packages in the distribution]' \
37      '(-b --binary)'{-b,--binary}'[the following packages are binary]' \
38      '(-s --source)'{-s,--source}'[the following packages are source]' \
39      '--udeb[the following packages are udebs]' \
40      '(-p --packages-file)'{-p,--packages-file}'[process packages listed in file]:list:_files' \
41      '*:package:_files -g "*.(changes|deb|dsc)(-.)"' && return 0
42      ;;
43
44   (lintian-info)
45      _arguments -C '1: :->cmds' '*: :->args' && ret=0
46
47      case $state in
48        (cmds)
49          cmds=(
50             {-t,--tags}':print long description of arguments'
51             {-a,--annotate}':annotate override entries from stdin'
52          )
53          _describe -t commands 'lintian-info command' cmds && ret=0
54        ;;
55        (args)
56          case $line[1] in
57            -t|--tags)
58              _wanted tag expl 'tag' compadd $(command awk '/^Tag:/ { print $2 }' /usr/share/lintian/checks/*.desc) && ret=0
59            ;;
60          esac
61        ;;
62      esac
63      ;;
64esac
65
66return ret
67