about summary refs log tree commit diff
path: root/Completion/Debian
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-01-17 09:23:34 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-01-17 09:23:34 +0000
commit5385a822b6de0fc5a805dfe99f78bdafdd476736 (patch)
tree5349ab762783b8831cd63a718de149639d3b63de /Completion/Debian
parent1e7c463fd951b1446f219b5ac54295496755b359 (diff)
downloadzsh-5385a822b6de0fc5a805dfe99f78bdafdd476736.tar.gz
zsh-5385a822b6de0fc5a805dfe99f78bdafdd476736.tar.xz
zsh-5385a822b6de0fc5a805dfe99f78bdafdd476736.zip
18121: add new function for completing e-mail addresses
Diffstat (limited to 'Completion/Debian')
-rw-r--r--Completion/Debian/Command/_bts206
1 files changed, 94 insertions, 112 deletions
diff --git a/Completion/Debian/Command/_bts b/Completion/Debian/Command/_bts
index 61f36a841..55dac987e 100644
--- a/Completion/Debian/Command/_bts
+++ b/Completion/Debian/Command/_bts
@@ -1,118 +1,100 @@
 #compdef bts
+
 local expl
 
 compset -N '[,.]' || compset -n 2
 
-if [[ CURRENT -eq 1 ]];
-then
- _wanted cmd expl 'bts command' \
- compadd show bugs close reopen retitle reassign merge unmerge tag \
-         severity forwarded notforwarded help
-else
- case "$words[1]" in
- 	show|close|unmerge|notforwarded)
-	 if [[ CURRENT -eq 2 ]];
-	 then
-	  _wanted bugnum expl 'bug number' compadd
-	 else
-	  _wanted sep expl 'separator' compadd -S ' ' , .
-	 fi
-	;;
-	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
-	  _wanted bugnum expl 'bug number' compadd
-	 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
-	  _wanted bugnum expl 'bug number' compadd
-	 elif [[ CURRENT -eq 3 ]];
-	 then
-	  _wanted submitter expl 'new title' compadd
-	 else
-	  _wanted sep expl 'separator' compadd -S ' ' , .
-	 fi
-	;;
-	reassign)
-	 if [[ CURRENT -eq 2 ]];
-	 then
-	  _wanted bugnum expl 'bug number' compadd
-	 elif [[ CURRENT -eq 3 ]];
-	 then
-	  _wanted submitter expl 'new package' _deb_packages avail
-	 else
-	  _wanted sep expl 'separator' compadd -S ' ' , .
-	 fi
-	;;
-	merge)
-	 _wanted bugnum expl 'bug number' compadd
-	 if [[ CURRENT -gt 2 ]];
-	 then
-	  _wanted sep expl 'separator' compadd -S ' ' , .
-	 fi
-	;;
-	tag)
-	 if [[ CURRENT -eq 2 ]];
-	 then
-	  _wanted bugnum expl 'bug number' compadd
-	 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 \
-		  sarge experimental
-	 else
-	  _wanted tag expl 'tag' \
-	  compadd patch wontfix moreinfo unreproducible fixed \
-	          security potato woody sid help pending upstream \
-		  sarge experimental
-	  _wanted sep expl 'separator' compadd -S ' ' , .
-	 fi
-	;;
-	severity)
-	 if [[ CURRENT -eq 2 ]];
-	 then
-	  _wanted bugnum expl 'bug number' compadd
-	 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
-	  _wanted bugnum expl 'bug number' compadd
-	 elif [[ CURRENT -eq 3 ]];
-	 then
-	  _wanted upstream expl 'upstream email' compadd
-	 else
-	  _wanted sep expl 'separator' compadd -S ' ' , .
-	 fi
-	;;
-	help)
-	;&
-	*) _wanted sep expl 'separator' compadd -S ' ' , .
-	;;
- esac
+if [[ CURRENT -eq 1 ]]; then
+  _wanted cmd expl 'bts command' compadd show bugs close reopen retitle \
+      reassign merge unmerge tag severity forwarded notforwarded help
+  return
 fi
+
+case "$words[1]" in
+  show|close|unmerge|notforwarded)
+    if [[ CURRENT -eq 2 ]]; then
+      _message -e bugnum 'bug number'
+    else
+      _wanted sep expl 'separator' compadd -S ' ' , .
+    fi
+  ;;
+  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
+  ;;
+  tag)
+    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 sarge experimental
+    else
+      _wanted tag expl 'tag' \
+	  compadd patch wontfix moreinfo unreproducible fixed security \
+	  potato woody sid help pending upstream sarge experimental
+      _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
+  ;;
+  help)
+  ;&
+  *) _wanted sep expl 'separator' compadd -S ' ' , .
+  ;;
+esac