1#compdef bug reportbug querybts
2
3local _bug_commonargs _rb_commonargs
4
5_bug_commonargs=(
6  '-d[debug: send mail to postmaster@localhost]'
7  '-m[maintainer-only]'
8  '-p[print to stdout instead of mail]'
9  '-h[help]'
10  '*:package:_deb_packages installed'
11)
12
13_rb_commonargs=(
14  '(-B --bts)'{-B,--bts=}'[use alternate BTS]:system:(debian gnome kde tdyc kde-debian)'
15  '(-l --ldap)'{-l,--ldap}'[enable LDAP support]'
16  '(-l --ldap)--no-ldap[disable LDAP support]'
17  '(--proxy --http_proxy)'--{http_,}'proxy=:proxy host:_hosts'
18)
19
20case "$service" in
21  bug)
22    _arguments \
23      '-c[exclude configs from report]' \
24      '-f[argument is a file, not a package]' \
25      '-H[special header]:custom header:' \
26      '-q[quiet - no e-mail forwarding]' \
27      '-s[set subject]:subject:' \
28      '-S[set severity]:severity:(wishlist normal important serious grave critical)' \
29      '-v[version]' \
30      '-x[do not cc submitter]' \
31      '-z[send configs verbatim]' \
32      "$_bug_commonargs[@]"
33  ;;
34  reportbug)
35    _arguments \
36      '(-c --no-config-files)'{-c,--no-config-files}'[exclude configs from report]' \
37      '(-f --filename)'{-f,--filename=}'[argument is a file, not a package]:filename:_files' \
38      '(-H --header)'{-H,--header=}'[special header]:custom header' \
39      '(-s --subject)'{-s,--subject=}'[set subject]:subject' \
40      '(-S --severity)'{-S,--severity=}'[set severity]:severity:(wishlist normal important serious grave critical)' \
41      '(-x --no-cc)'{-x,--no-cc}'[do not cc submitter]' \
42      '(-z --no-compress)'{-z,--no-compress}'[send configs verbatim]' \
43      '(-a --af)'{-a,--af}'[use af instead of editor]' \
44      '(-g --gpg --gnupg)'{-g,--gpg,--gnupg}'[sign report with GnuPG]' \
45      '(-i --include)'{-i,--include}'[include text]:include file:_files' \
46      '(-A --attach)'{-A,--attach=}'[attach file]:attachment:_files' \
47      '(-M --mutt)'{-M,--mutt}'[use mutt instead of editor]' \
48      '(-G --gnus)'{-G,--gnus}'[use GNUS instead of editor]' \
49      '(-e --editor)'{-e,--editor=}'[use specified editor instead of editor]:editor' \
50      '--mua=[use specified mua instead of editor]' \
51      '--mta=[use specified mta]' \
52      '(-n --nmh --mh)'{-n,--nmh,--mh}'[use comp instead of editor]' \
53      '(-o --output)'{-o,--output=}'[output to file instead of mail]:output file:_files' \
54      '(-P --pgp)'{-P,--pgp}'[sign report with PGP]' \
55      '(-C --class)'{-C,--class=}':GNATS report class' \
56      '--realname=:real name' \
57      '(--replyto)--reply-to=' \
58      '(--reply-to)--replyto=' \
59      '--email=:originating address:_email_addresses' \
60      '--smtphost=:SMTP server:_hosts' \
61      '(-p --print)'{-p,--print}'[print to stdout instead of mail]' \
62      '(-q --quiet)'{-q,--quiet}'[reduce verbosity of output]' \
63      '(--no-query-source)--query-source' \
64      '(--query-source)--no-query-source' \
65      '(--no-debconf)--debconf' \
66      '(--debconf)--no-debconf' \
67      '(-Q --query-only)'{-Q,--query-only}'[do not submit]' \
68      '(-j --justification)'{-j,--justification=}':justification' \
69      '(-V --package-version)'{-V,--package-version=}':package version' \
70      '(-u --interface)'{-u,--interface=}':user interface' \
71      '(-t --type)'{-t,--type=}':type of report' \
72      '--template[output a template report only]' \
73      '--configure[reconfigure reportbug for this user]' \
74      '(--no-check-available)--check-available' \
75      '(--check-available)--no-check-available' \
76      '--mode=' \
77      '(-v --verify --no-verify)'{-v,--verify}'[verify integrity with debsums]' \
78      '(--verify -v)--no-verify' \
79      '(-k --kudos)'{-k,--kudos}'[send appreciative email to maintainer]' \
80      '--mirror=:BTS mirror:_hosts' \
81      '--list-cc=:carbon copy:' \
82      '--report-quiet' \
83      '(-O --offline)'{-O,--offline}'[disable external queries]' \
84      '(-b --no-query-bts --query-bts)'{-b,--no-query-bts}'[do not query BTS]' \
85      '(-b --no-query-bts)--query-bts' \
86      '(-T --tags)'{-T,--tags=}'[add specified tags]:tags' \
87      '(-m)--maintonly' \
88      '(-d)--debug' \
89      '--version' \
90      '--license' \
91      '(--no-paranoid)--paranoid' \
92      '(--paranoid)--no-paranoid' \
93      '--body=:message body string' \
94      '--body-file=:message body file:_files' \
95      "$_bug_commonargs[@]" \
96      "$_rb_commonargs[@]"
97  ;;
98  querybts)
99    _arguments \
100      '(-w --web)'{-w,--web}'[launch external web browser]' \
101      '(-A --archive)'{-A,--archive}'[browse archived bugs]' \
102      '(-s --source)'{-s,--source}'[query for source packages rather than binary]' \
103      '(-v --version)'{-v,--version}'[show version]' \
104      "$_rb_commonargs[@]" \
105      '*:package:_deb_packages avail'
106  ;;
107esac
108