about summary refs log tree commit diff
path: root/Completion/Debian
diff options
context:
space:
mode:
authorPaul Ackersviller <packersv@users.sourceforge.net>2007-10-09 02:44:37 +0000
committerPaul Ackersviller <packersv@users.sourceforge.net>2007-10-09 02:44:37 +0000
commit56e7d07643753014f51a2f1a521e238adadeb20f (patch)
treea571cc772629120f391057fd6461830799f1937a /Completion/Debian
parent5b62e604511c9c7365b56becaff998157fb8fee8 (diff)
downloadzsh-56e7d07643753014f51a2f1a521e238adadeb20f.tar.gz
zsh-56e7d07643753014f51a2f1a521e238adadeb20f.tar.xz
zsh-56e7d07643753014f51a2f1a521e238adadeb20f.zip
Merge up to 1.9 from trunk onto 4.2 branch.
Diffstat (limited to 'Completion/Debian')
-rw-r--r--Completion/Debian/Command/_bts200
1 files changed, 200 insertions, 0 deletions
diff --git a/Completion/Debian/Command/_bts b/Completion/Debian/Command/_bts
new file mode 100644
index 000000000..cf36e552a
--- /dev/null
+++ b/Completion/Debian/Command/_bts
@@ -0,0 +1,200 @@
+#compdef bts
+
+local expl first=1
+
+_arguments -A "-*" \
+  '(-o --offline)'{-o,--offline}'[use cached bugs]' \
+  '(--online --no-offline)'{--online,--no-offline}'[do not use cached bugs]' \
+  '(--cache --no-cache)--cache[cache new versions of pages]' \
+  '(--cache --no-cache)--no-cache[do not cache new versions of pages]' \
+  '--cache-mode=:cache mode:(min mbox full)' \
+  '--cache-delay=:seconds:' \
+  '--mbox[open a mail reader to read the corresponding mbox]' \
+  '--mailreader=:reader:' \
+  '(-f --force-refresh)'{-f,--force-refresh}'[download bug report even if unchanged]' \
+  '-no-force-refresh[do not force refresh]' \
+  '(-q --quiet)*'{-q,--quiet}'[only display info about newly cached pages]' \
+  '(--no-conf --noconf)*'{--no-conf,--noconf}'[do not read any config files]' \
+  '*:subcommand and args:->subcmds' && return 0
+
+compset -N '-[^0-9]#' && first=0
+compset -N '[,.]' && first=0
+[[ $first -eq 0 ]] || compset -n 2
+
+if [[ CURRENT -eq 1 ]]; then
+  _wanted cmd expl 'bts command' compadd show bugs close reopen retitle \
+      reassign merge unmerge tag tags severity forwarded notforwarded help \
+      clone submitter found notfound block unblock user usertag usertags \
+      package owner noowner reportspam cache cleancache
+  return
+fi
+
+case "$words[1]" in
+  (close|unmerge|notforwarded|noowner|reportspam)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    else
+      _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  (show|bugs)
+    if [[ CURRENT -eq 2 ]]; then
+      _wanted package expl 'package' _deb_packages avail
+      _wanted maintainer expl 'package maintainer' compadd $DEBEMAIL
+    fi
+    _wanted sep expl 'separator' compadd -S ' ' , .
+  ;;
+  reopen)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+      _wanted submitter expl 'new submitter' compadd $DEBEMAIL
+    else
+      _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  retitle)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+     _message -e submitter 'new title'
+    else
+     _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  reassign)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+     _wanted submitter expl 'new package' _deb_packages avail
+    else
+     _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  merge)
+    _message -e bugnum 'bug number'
+    if [[ CURRENT -gt 2 ]]; then
+     _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  tags#)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+      _wanted operator expl 'operator' compadd - '+' '-' '='
+    elif [[ CURRENT -eq 4 ]]; then
+      _wanted tag expl 'tag' \
+	 compadd patch wontfix moreinfo unreproducible fixed security \
+	 potato woody sid help pending upstream lfs sarge experimental \
+	 sarge-ignore d-i confirmed ipv6 fixed-in-experimental \
+	 fixed-upstream
+    else
+      _wanted tag expl 'tag' \
+	 compadd patch wontfix moreinfo unreproducible fixed security \
+	 potato woody sid help pending upstream lfs sarge experimental \
+	 sarge-ignore d-i confirmed ipv6 fixed-in-experimental \
+	 fixed-upstream
+      _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  severity)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+      _wanted severity expl 'severity' \
+	  compadd wishlist minor normal serious important critical grave
+    else
+      _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  forwarded)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+     _wanted upstream expl 'upstream email' _email_addresses -c
+    else
+     _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  (clone)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 || -prefix [-] ]]; then
+     _wanted newid expl 'new ID' compadd -- -{1..9}
+    else
+     _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  (submitter|owner)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    else
+     _alternative \
+       'bugnum:bug number:' \
+       'email:email address:_email_addresses -c' \
+       'bang:bang:compadd \!'
+    fi
+  ;;
+  (found|notfound)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+      _message -e version 'version'
+    else
+      _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  (block|unblock)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+      _wanted prep expl 'preposition' compadd by with
+    else
+     _alternative \
+       'bugnum:bug number:' \
+       'separator:separator:compadd -S " " , .'
+    fi
+  ;;
+  (user)
+    if [[ CURRENT -eq 2 ]]; then
+      _wanted upstream expl 'user email for usertags' _email_addresses -c
+    else
+      _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  (usertags#)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    elif [[ CURRENT -eq 3 ]]; then
+      _wanted operator expl 'operator' compadd - '+' '-' '='
+    elif [[ CURRENT -eq 4 ]]; then
+      _message -e usertag 'user tag'
+    else
+      _message -e usertag 'user tag'
+      _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  (package)
+    if [[ CURRENT -eq 2 ]]; then
+     _wanted package expl 'package' _deb_packages avail
+    else
+     _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  (cache)
+     _alternative \
+       'package:package:_deb_packages avail' \
+       'email:email address:_email_addresses -c' \
+       'rc:rc:compadd release-critical'
+  ;;
+  (cleancache)
+     _alternative \
+       'package:package:_deb_packages avail' \
+       'email:email address:_email_addresses -c' \
+       'all:all:compadd ALL'
+  ;;
+  help)
+  ;&
+  *) _wanted sep expl 'separator' compadd -S ' ' , .
+  ;;
+esac