summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Completion/Base/Utility/_nothing2
-rw-r--r--Completion/Cygwin/Command/_cygpath15
-rw-r--r--Completion/Cygwin/Command/_cygrunsrv58
-rw-r--r--Completion/Cygwin/Command/_getclip15
-rw-r--r--Completion/Cygwin/Command/_getfacl10
-rw-r--r--Completion/Cygwin/Command/_mkshortcut33
-rw-r--r--Completion/Cygwin/Command/_pscp20
-rw-r--r--Completion/Cygwin/Command/_putclip14
-rw-r--r--Completion/Debian/Command/_auto-apt68
-rw-r--r--Completion/Debian/Command/_bug230
-rw-r--r--Completion/Debian/Command/_debchange19
-rw-r--r--Completion/Debian/Command/_debfoster149
-rw-r--r--Completion/Debian/Command/_debsign25
-rw-r--r--Completion/Debian/Command/_dpkg93
-rw-r--r--Completion/Debian/Command/_dpkg_source51
-rw-r--r--Completion/Debian/Command/_dput37
-rw-r--r--Completion/Debian/Command/_dupload35
-rw-r--r--Completion/Debian/Command/_update-alternatives103
-rw-r--r--Completion/Linux/Command/_iptables4
-rw-r--r--Completion/Linux/Command/_pkgtool109
-rw-r--r--Completion/Redhat/Command/_rpm315
-rw-r--r--Completion/Unix/Command/_apm78
-rw-r--r--Completion/Unix/Command/_arping36
-rw-r--r--Completion/Unix/Command/_cvs370
-rw-r--r--Completion/Unix/Command/_fakeroot11
-rw-r--r--Completion/Unix/Command/_fsh36
-rw-r--r--Completion/Unix/Command/_global68
-rw-r--r--Completion/Unix/Command/_global_tags9
-rw-r--r--Completion/Unix/Command/_imagemagick490
-rw-r--r--Completion/Unix/Command/_irssi59
-rw-r--r--Completion/Unix/Command/_mysql_utils158
-rw-r--r--Completion/Unix/Command/_pbm637
-rw-r--r--Completion/Unix/Command/_rar209
-rw-r--r--Completion/Unix/Command/_rsync193
-rw-r--r--Completion/Unix/Command/_slrn35
-rw-r--r--Completion/Unix/Command/_user_admin6
-rw-r--r--Completion/Unix/Command/_vorbis184
-rw-r--r--Completion/X/Command/_acroread83
-rw-r--r--Completion/X/Type/_x_color5
39 files changed, 1968 insertions, 2104 deletions
diff --git a/Completion/Base/Utility/_nothing b/Completion/Base/Utility/_nothing
index 9551022f9..1f69155ae 100644
--- a/Completion/Base/Utility/_nothing
+++ b/Completion/Base/Utility/_nothing
@@ -1,3 +1,3 @@
-#compdef true false log times clear logname whoami
+#compdef true false log times clear logname whoami sync
 
 _message 'no argument or option'
diff --git a/Completion/Cygwin/Command/_cygpath b/Completion/Cygwin/Command/_cygpath
index 570639e6c..0ecfccc2e 100644
--- a/Completion/Cygwin/Command/_cygpath
+++ b/Completion/Cygwin/Command/_cygpath
@@ -1,14 +1,12 @@
 #compdef cygpath cygpath.exe
 #Generated by Felix Rosencrantz
 
-local context state line
-typeset -A opt_args
 _arguments  \
   '(--dos --mixed --type --unix --windows -d -m -t -u -w)'{-d,--dos}'[print DOS (short) form of NAME (C:\PROGRA~1\)]' \
   '(--dos --mixed --type --unix --windows -d -m -t -u -w)'{-m,--mixed}'[like --windows, but with regular slashes (C:/WINNT)]' \
   '(--dos --mixed --type --unix --windows -d -m -t -u -w)'{-u,--unix}'[(default) print Unix form of NAME (/cygdrive/c/winnt)]' \
   '(--dos --mixed --type --unix --windows -d -m -t -u -w)'{-w,--windows}'[print Windows form of NAME (C:\WINNT)]' \
-  "(--dos --mixed --type --unix --windows -d -m -t -u -w)"{-t,--type}":print TYPE form\: 'dos', 'mixed', 'unix', or 'windows':(dos mixed unix windows)" \
+  '(--dos --mixed --type --unix --windows -d -m -t -u -w)'{-t,--type}':print type:(dos mixed unix windows)' \
   '(--absolute --long-name --path --short-name -a -l -p -s)'{-a,--absolute}'[output absolute path]' \
   '(--absolute --long-name --path --short-name -a -l -p -s)'{-l,--long-name}'[print Windows long form of NAME (with -w, -m only)]' \
   "(--absolute --long-name --path --short-name -a -l -p -s)"{-p,--path}"[NAME is a PATH list (i.e., '/bin:/usr/bin')]" \
@@ -21,13 +19,8 @@ _arguments  \
   "(--desktop --homeroot --smprograms --sysdir --windir -D -H -P -S -W)"{-W,--windir}"[output 'Windows' directory and exit]" \
   '(--file -f)'{-f,--file}':read FILE for input; use - to read from STDIN:_files' \
   '(--option -o)'{-o,--option}'[read options from FILE as well (for use with --file)]' \
-  '(--close -c)'{-c,--close}':close HANDLE (for use in captured process):->HANDLE' \
+  '(--close -c)'{-c,--close}'[close specified handle (for use in captured process)]:handle' \
   '(--ignore -i)'{-i,--ignore}'[ignore missing argument]' \
-  '(--help -h)'{-h,--help}'[output usage information and exit]' \
-  '(--version -v)'{-v,--version}'[output version information and exit]' \
+  '(- 1)'{-h,--help}'[display usage information]' \
+  '(- 1)'{-v,--version}'[display version information]' \
   '1: :_files'  && return 0
-            
-case $state in
-  "HANDLE");;
-esac
-    
diff --git a/Completion/Cygwin/Command/_cygrunsrv b/Completion/Cygwin/Command/_cygrunsrv
index 08c23058e..725ac46a0 100644
--- a/Completion/Cygwin/Command/_cygrunsrv
+++ b/Completion/Cygwin/Command/_cygrunsrv
@@ -1,39 +1,25 @@
 #compdef cygrunsrv cygrunsrv.exe
-#Generated by Felix Rosencrantz
 
-local context state line
-typeset -A opt_args
 _arguments  \
-  '(--install -I)'{-I,--install}':Installes a new service named <svc_name>.:->svc_name' \
-  '(--remove -R)'{-R,--remove}':Removes a service named <svc_name>.:->svc_name' \
-  '(--start -S)'{-S,--start}':Starts a service named <svc_name>.:->svc_name' \
-  '(--stop -E)'{-E,--stop}':Stops a service named <svc_name>.:->svc_name' \
-  '(--path -p)'{-p,--path}':Application path which is run as a service.:->app_path' \
-  '(--args -a)'{-a,--args}':Optional string with command line options which is given to the service application on startup.:->args' \
-  '(--chdir -c)'{-c,--chdir}':Optional directory which will be used as working directory for the application.:_directories' \
-  '(--env -e)'{-e,--env}':Optional environment strings which are added to the environment when service is started. You can add up to 255 environment strings using:->VAR=VALUE' \
-  '(--disp -d)'{-d,--disp}':Optional string which contains the display name of the service. Defaults to service name.:->display_name' \
-  '(--desc -f)'{-f,--desc}':Optional string which contains the service description.:->description' \
-  "(--type -t)"{-t,--type}"[Optional start type of service. Defaults to 'auto'.]: :(auto manual)" \
-  '(--user -u)'{-u,--user}':Optional user name to start service as. Defaults to SYSTEM account.:_users' \
-  '(--passwd -w)'{-w,--passwd}':Optional password for user. Only needed if a user is given. If a user has an empty:->password' \
-  '(--termsig -s)'{-s,--termsig}':Optional signal to send to service application when service is stopped. <signal> can be a number or a signal name such as HUP, INT, QUIT, etc. Default is TERM.:_signals' \
-  '(--dep -y)'{-y,--dep}':Optional name of service that must be started:->svc_name2' \
-  '(--stdin -0)'{-0,--stdin}':Optional input file used for stdin redirection. Default is /dev/null.:_files' \
-  '(--stdout -1)'{-1,--stdout}':Optional output file used for stdout redirection. Default is /var/log/<svc_name>.log.:_files' \
-  '(--stderr -2)'{-2,--stderr}':Optional output file used for stderr redirection. Default is /var/log/<svc_name>.log.:_files' \
-  '(--shutdown -o)'{-o,--shutdown}'[Stop service application during system shutdown.]' \
-  '(--help -h)'{-h,--help}'[print this help, then exit.]' \
-  '(--version -v)'{-v,--version}'[print cygrunsrv program version number, then exit.]' \
-  '*: :_files'  && return 0
-            
-case $state in
-  "VAR=VALUE");;
-  "app_path");;
-  "args");;
-  "description");;
-  "display_name");;
-  "password");;
-  "svc_name");;
-  "svc_name2");;
-esac
+  '(-I --install)'{-I,--install}'[install a new service]:service' \
+  '(-R --remove)'{-R,--remove}'[remove specified service]:service' \
+  '(-S --start)'{-S,--start}'[start specified service]:service' \
+  '(-E --stop)'{-E,--stop}'[stop specified service]:service' \
+  '(-p --path)'{-p,--path}'[specify application path which is run as a service]:application path' \
+  '(-a --args)'{-a,--args}'[specify options to give service on startup]:args' \
+  '(-c --chdir)'{-c,--chdir}'[specify working directory for the application]:directory:_directories' \
+  '(-e --env)'{-e,--env}'[specify environment strings exported to service]:var=value' \
+  '(-d --disp)'{-d,--disp}'[specify display name for service]:display name' \
+  '(-f --desc)'{-f,--desc}'[specify service description]:description' \
+  '(-t --type)'{-t,--type}'[specify service start type]:start type:(auto manual)' \
+  '(-u --user)'{-u,--user}'[specify user to start service under]:user:_users' \
+  '(-w --passwd)'{-w,--passwd}'[specify password for user]:password' \
+  '(-s --termsig)'{-s,--termsig}'[specify signal to use to stop service]:signal:_signals' \
+  '(-y --dep)'{-y,--dep}'[specify name of service that must be started]:service' \
+  '(-0 --stdin)'{-0,--stdin}'[specify file for stdin redirection]:file:_files' \
+  '(-1 --stdout)'{-1,--stdout}'[specify file for stdout redirection]:file:_files' \
+  '(-2 --stderr)'{-2,--stderr}'[specify file for stderr redirection]:file:_files' \
+  '(-o --shutdown)'{-o,--shutdown}'[stop service application during system shutdown]' \
+  '(- *)'{-h,--help}'[print help information]' \
+  '(- *)'{-v,--version}'[print version information]' \
+  '*: :_files'
diff --git a/Completion/Cygwin/Command/_getclip b/Completion/Cygwin/Command/_getclip
index 0cb7b093f..c27e2dfdd 100644
--- a/Completion/Cygwin/Command/_getclip
+++ b/Completion/Cygwin/Command/_getclip
@@ -1,13 +1,10 @@
 #compdef getclip getclip.exe
 #Generated by Felix Rosencrantz
 
-local context state line
-typeset -A opt_args
 _arguments \
-  '(--dos -d)'{-d,--dos}'[Output text will have DOS line endings.]' \
-  '(--unix -u)'{-u,--unix}'[Output text will have UNIX line endings.]' \
-  '(--help -?)'{'-?',--help}'[Show this help message]' \
-  '--usage[Display brief usage message]' \
-  '--version[Display version information]' \
-  '--license[Display licensing information]'
-            
+  '(--dos -d)'{-d,--dos}'[output text will have DOS line endings]' \
+  '(--unix -u)'{-u,--unix}'[output text will have UNIX line endings]' \
+  '(-)'{-\?,--help}'[show this help message]' \
+  '(-)--usage[display brief usage message]' \
+  '(-)--version[display version information]' \
+  '(-)--license[display licensing information]'
diff --git a/Completion/Cygwin/Command/_getfacl b/Completion/Cygwin/Command/_getfacl
index a0adf6866..8e794131f 100644
--- a/Completion/Cygwin/Command/_getfacl
+++ b/Completion/Cygwin/Command/_getfacl
@@ -1,12 +1,10 @@
 #compdef getfacl getfacl.exe
 #Generated by Felix Rosencrantz
 
-local context state line
-typeset -A opt_args
 _arguments  \
-  '(--all -a)'{-a,--all}'[display the filename, the owner, the group, and the ACL of the file]' \
-  '(--dir -d)'{-d,--dir}'[display the filename, the owner, the group, and the default ACL of the directory, if it exists]' \
-  '(--help -h)'{-h,--help}'[output usage information and exit]' \
+  '(--all -a)'{-a,--all}'[display the filename, owner, group, and ACL of the file]' \
+  '(--dir -d)'{-d,--dir}'[display the filename, owner, group, and default ACL of the directory]' \
   '(--noname -n)'{-n,--noname}'[display user and group IDs instead of names]' \
-  '(--version -v)'{-v,--version}'[output version information and exit]' \
+  '(- *)'{-h,--help}'[display help information]' \
+  '(- *)'{-v,--version}'[display version information]' \
   '*: :_files'
diff --git a/Completion/Cygwin/Command/_mkshortcut b/Completion/Cygwin/Command/_mkshortcut
index 2a9d558aa..8718fa146 100644
--- a/Completion/Cygwin/Command/_mkshortcut
+++ b/Completion/Cygwin/Command/_mkshortcut
@@ -1,24 +1,15 @@
 #compdef mkshortcut mkshortcut.exe
-#Generated by Felix Rosencrantz
 
-local context state line
-typeset -A opt_args
 _arguments  \
-  '(--arguments -a)'{-a,--arguments=-}':Use arguments ARGS:->ARGS' \
-  '(--icon -i)'{-i,--icon=-}':icon file for link to use:_files' \
-  '(--iconoffset -j)'{-j,--iconoffset=-}':offset of icon in icon file (default is 0):->INT' \
-  '(--name -n)'{-n,--name=-}':name for link (defaults to TARGET):_files' \
-  "(--allusers -A)"{-A,--allusers}"[use 'All Users' instead of current user for -D,-P]" \
-  "(--desktop -D)"{-D,--desktop}"[create link relative to 'Desktop' directory]" \
-  "(--smprograms -P)"{-P,--smprograms}"[create link relative to Start Menu 'Programs' directory]" \
-  '(--help -h)'{-h,--help}'[Show this help message]' \
-  '--usage[Display brief usage message]' \
-  '(--version -v)'{-v,--version}'[Display version information]' \
-  '--license[Display licensing information]' \
-  '1:Target:_files'  && return 0
-            
-case $state in
-  "ARGS");;
-  "INT");;
-esac
-    
+  '(--arguments -a)'{-a,--arguments=-}'[use specified arguments]:arguments' \
+  '(--icon -i)'{-i,--icon=-}'[specify icon file for link to use]:icon file:_files' \
+  '(--iconoffset -j)'{-j,--iconoffset=-}'[specify offset of icon in icon file]:offset' \
+  '(--name -n)'{-n,--name=-}'[specify name for link]:file:_files' \
+  '(--allusers -A)'{-A,--allusers}"[use 'All Users' instead of current user for -D,-P]" \
+  '(--desktop -D)'{-D,--desktop}"[create link relative to 'Desktop' directory]" \
+  '(--smprograms -P)'{-P,--smprograms}"[create link relative to Start Menu 'Programs' directory]" \
+  '(- 1)'{-h,--help}'[show help information]' \
+  '(- 1)--usage[display brief usage message]' \
+  '(- 1)'{-v,--version}'[show version information]' \
+  '(- 1)--license[display licensing information]' \
+  '1:target:_files'
diff --git a/Completion/Cygwin/Command/_pscp b/Completion/Cygwin/Command/_pscp
index f04afb8d1..c2b8dd979 100644
--- a/Completion/Cygwin/Command/_pscp
+++ b/Completion/Cygwin/Command/_pscp
@@ -1,24 +1,18 @@
 #compdef pscp pscp.exe
 #Generated by Felix Rosencrantz
 
-local context state line
-typeset -A opt_args
-_arguments  \
+_arguments \
   '-p[preserve file attributes]' \
   "-q[quiet, don't show statistics]" \
   '-r[copy directories recursively]' \
   '-v[show verbose messages]' \
-  '-load:Load settings from saved session:->sessname' \
-  '-P:connect to specified port:_ports' \
-  '-l:connect with specified username:_users' \
-  '-pw[passw login with specified password]' \
+  '-load[load settings from saved session]:session' \
+  '-P[connect to specified port]:port:_ports' \
+  '-l[connect with specified username]:username:_users' \
+  '-pw[login with specified password]:password' \
   '(-1 -2)'{-1,-2}'[force use of particular SSH protocol version]' \
   '-C[enable compression]' \
-  '-i:private key file for authentication:_files' \
+  '-i[specify private key file for authentication]:private key file:_files' \
   '-batch[disable all interactive prompts]' \
   '-unsafe[allow server-side wildcards (DANGEROUS)]' \
-  '*: :_files'  && return 0
-            
-case $state in
-  "sessname");;
-esac
+  '*: :_files'
diff --git a/Completion/Cygwin/Command/_putclip b/Completion/Cygwin/Command/_putclip
index db61f438d..484d054ee 100644
--- a/Completion/Cygwin/Command/_putclip
+++ b/Completion/Cygwin/Command/_putclip
@@ -1,12 +1,10 @@
 #compdef putclip putclip.exe
 #Generated by Felix Rosencrantz
 
-local context state line
-typeset -A opt_args
 _arguments \
-  '(--dos -d)'{-d,--dos}'[Clipboard text will have DOS line endings.]' \
-  '(--unix -u)'{-u,--unix}'[Clipboard text will have UNIX line endings.]' \
-  '(--help -?)'{'-?',--help}'[Show this help message]' \
-  '--usage[Display brief usage message]' \
-  '--version[Display version information]' \
-  '--license[Display licensing information]'
+  '(--dos -d)'{-d,--dos}'[clipboard text will have DOS line endings]' \
+  '(--unix -u)'{-u,--unix}'[clipboard text will have UNIX line endings]' \
+  '(-)'{'-?',--help}'[show this help message]' \
+  '(-)--usage[display brief usage message]' \
+  '(-)--version[display version information]' \
+  '(-)--license[display licensing information]'
diff --git a/Completion/Debian/Command/_auto-apt b/Completion/Debian/Command/_auto-apt
index 92af817c1..2e6dccbc1 100644
--- a/Completion/Debian/Command/_auto-apt
+++ b/Completion/Debian/Command/_auto-apt
@@ -1,57 +1,31 @@
 #compdef auto-apt
 
-local expl prev ret
-
-prev="$words[CURRENT-1]"
+local expl prev="$words[CURRENT-1]"
 
 # if there is a command in arguments ?
 if [[ -n $words[(r)(run|update|update-local|merge|del|check|list|search|debuilt|status)] ]] ; then
 
-    # yes, add completion for command arguments and command options
-    if [[ -n $words[(r)(update|update-local|merge)] && "$words[CURRENT]" = -* ]] ; then
-	_wanted option expl 'option' compadd - "-a" && return 0;
-    fi
+  # yes, add completion for command arguments and command options
+  if [[ -n $words[(r)(update|update-local|merge)] && "$words[CURRENT]" = -* ]] ; then
+    _wanted option expl 'option' compadd - "-a" && return;
+  fi
 
-    if [[ -n $words[(r)(check|list|search)] && "$words[CURRENT]" = -* ]] ; then
-	_wanted option expl 'option' compadd - "-v" "-f" && return 0;
-    fi
+  if [[ -n $words[(r)(check|list|search)] && "$words[CURRENT]" = -* ]] ; then
+    _wanted option expl 'option' compadd - "-v" "-f" && return;
+  fi
 
-    case $prev in
-	"run")
-	    _wanted command expl 'command' _files -g '*(/,*)' && return 0 ;;
-	"del")
-	    _wanted package expl 'package' _deb_packages avail && return 0 ;;
-    esac
+  case $prev in
+    run) _wanted command expl 'command' _files -g '*(/,*)' && return ;;
+    del) _wanted package expl 'package' _deb_packages avail && return ;;
+  esac
 else
-    # no, add completion for commands or options (and options arguments)
-    case $prev in 
-	"-a")
-	    local distribs
-	    distribs=("main" "contrib" "non-free" "non-US" "none")
-	    
-	    _values -s , 'distribution' $distribs ;;
-	"-p")
-	    local hooks
-	    hooks=("exec" "open" "access" "stat" "none")
-	    _values -s , 'hook' $hooks ;;
-	"-D")
-	    _wanted file expl 'dbfile' _files ;;
-	"-F")
-	    _wanted file expl 'filedb' _files ;;
-	*)
-	    
-	    local commands options
-	    
-	    commands=("run" "update" "update-local" "merge" "del" "check" "list" "search" "debuild" "status")
-	    options=("-h" "-s" "-y" "-q" "-i" "-X" "-x" "-a" "-p" "-D" "-F" "-L")
-	    
-	    if [[ "$words[CURRENT]" = -* ]] ; then
-		_wanted option expl 'option' compadd - $options
-	    else
-		_wanted command expl 'command' compadd $commands
-	    fi
-	    ;;
-    esac
-
-    return 0
+  _arguments \
+    '-a:distribution:_values -s , distribution main contrib non-free non-US none' \
+    '-p:hook:_values -s , hook exec open access stat none' \
+    '-D:dbfile:_files' \
+    '-F:filedb:_files' \
+    -h -s -y -q -i -X -x -L \
+    '*:command:(run update update-local merge del check list search debuild status)' && return
 fi
+
+return 1
diff --git a/Completion/Debian/Command/_bug b/Completion/Debian/Command/_bug
index d0fe5fa39..9bd2cb569 100644
--- a/Completion/Debian/Command/_bug
+++ b/Completion/Debian/Command/_bug
@@ -2,140 +2,104 @@
 
 local _bug_commonargs _rb_commonargs
 
-_bug_commonargs=('-d[debug: send mail to postmaster@localhost]' \
-           '-m[maintainer-only]' \
-           '-p[print to stdout instead of mail]' \
-           '-h[help]' \
-           '*:package:_deb_packages installed')
+_bug_commonargs=(
+  '-d[debug: send mail to postmaster@localhost]'
+  '-m[maintainer-only]'
+  '-p[print to stdout instead of mail]'
+  '-h[help]'
+  '*:package:_deb_packages installed'
+)
 
-
-_rb_commonargs=('(--bts)-B[use alternate BTS]:system:(debian gnome kde tdyc kde-debian)' \
-           '(-B)--bts=:system:(debian gnome kde tdyc kde-debian)' \
-           '(--ldap)-l[enable LDAP support]' \
-           '(-l)--ldap' \
-           '--no-ldap[disable LDAP support]' \
-	   '(--http_proxy)--proxy=:proxyhost:_hosts' \
-	   '(--proxy)--http_proxy=:proxyhost:_hosts')
+_rb_commonargs=(
+  '(-B --bts)'{-B,--bts=}'[use alternate BTS]:system:(debian gnome kde tdyc kde-debian)'
+  '(-l --ldap)'{-l,--ldap}'[enable LDAP support]'
+  '(-l --ldap)--no-ldap[disable LDAP support]'
+  '(--http_proxy)--proxy=:proxyhost:_hosts'
+  '(--proxy)--http_proxy=:proxyhost:_hosts'
+)
 
 case "$service" in
-bug)
-_arguments '-c[exclude configs from report]' \
-           '-f[argument is a file, not a package]' \
-           '-H[special header]:custom header:' \
-           '-q[quiet - no e-mail forwarding]' \
-           '-s[set subject]:subject:' \
-           '-S[set severity]:severity:(wishlist normal important serious grave critical)' \
-           '-v[version]' \
-           '-x[do not cc submitter]' \
-           '-z[send configs verbatim]' \
-           "$_bug_commonargs[@]"
-;;
-
-reportbug)
-_arguments '(--no-config-files)-c[exclude configs from report]' \
-           '(-c)--no-config-files' \
-           '(--filename)-f[argument is a file, not a package]:filename:_files' \
-           '(-f)--filename=:filename:_files' \
-           '(--header)-H[special header]:custom header:' \
-           '(-H)--header=:custom header:' \
-           '(--subject)-s[set subject]:subject:' \
-           '(-s)--subject=:subject:' \
-           '(--severity)-S[set severity]:severity:(wishlist normal important serious grave critical)' \
-           '(-S)--severity=:severity:(wishlist normal important serious grave critical)' \
-           '(--no-cc)-x[do not cc submitter]' \
-           '(-x)--no-cc' \
-           '(--no-compress)-z[send configs verbatim]' \
-           '(-z)--no-compress[send configs verbatim]' \
-           '(--af)-a[use af instead of editor]' \
-           '(-a)--af[use af instead of editor]' \
-           '(--no-bts-query)-b[do not check bts]' \
-           '(-b)--no-bts-query' \
-           '(--gpg --gnupg)-g[sign report with GnuPG]' \
-           '(-g --gpg)--gnupg[sign report with GnuPG]' \
-           '(-g --gnupg)--gpg[sign report with GnuPG]' \
-           '(--include)-i[include text]:include file:_files' \
-           '(-i)--include=:include file:_files' \
-           '(--attach)-A[attach file]:attachment:_files' \
-           '(-A)--attach=:attachment:_files' \
-           '(--mutt)-M[use mutt instead of editor]' \
-           '(-M)--mutt' \
-           '(--gnus)-G[use GNUS instead of editor]' \
-           '(-G)--gnus' \
-           '(--editor)-e[use specified editor instead of editor]:editor:' \
-           '(-e)--editor=:editor:' \
-           '--mua=[use specified mua instead of editor]' \
-           '--mta=[use specified mta]' \
-           '(--nmh --mh)-n[use comp instead of editor]' \
-           '(-n --mh)--nmh' \
-           '(--nmh -n)--mh' \
-           '(--output)-o[output to file instead of mail]:output file:_files' \
-           '(-o)--output=:output file:_files' \
-           '(--pgp)-P[sign report with PGP]' \
-           '(-P)--pgp' \
-	   '(--class)-C:GNATS report class:' \
-	   '(-C)--class=:GNATS report class:' \
-           '--realname=:real name:' \
-           '(--replyto)--reply-to=' \
-           '(--reply-to)--replyto=' \
-           '--email=:originating address:' \
-           '--smtphost=:SMTP server:_hosts' \
-           '(--print)-p[print to stdout instead of mail]' \
-           '(-p)--print' \
-           '(--quiet)-q[reduce verbosity of output]' \
-           '(-q)--quiet' \
-           '(--no-query-source)--query-source' \
-           '(--query-source)--no-query-source' \
-           '(--no-debconf)--debconf' \
-           '(--debconf)--no-debconf' \
-           '(--query-only)-Q[do not submit]' \
-           '(-Q)--query-only' \
-	   '(--justification)-j:justification:' \
-	   '(-j)--justification=:justification:' \
-	   '(--package-version)-V:package version:' \
-	   '(-V)--package-version=:package version:' \
-	   '(--interface)-u:user interface:' \
-	   '(-u)--interface=:user interface:' \
-	   '(--type)-t:type of report:' \
-	   '(-t)--type=:type of report:' \
-	   '--template[output a template report only]' \
-	   '--configure[reconfigure reportbug for this user]' \
-	   '(--no-check-available)--check-available' \
-	   '(--check-available)--no-check-available' \
-	   '--mode=' \
-	   '(--verify --no-verify)-v[verify integrity with debsums]' \
-	   '(--no-verify -v)--verify' \
-	   '(--verify -v)--no-verify' \
-	   '(--kudos)-k[send appreciative email to maintainer]' \
-	   '(-k)--kudos' \
-	   '--mirror=:BTS mirror:_hosts' \
-	   '--list-cc=:carbon copy:' \
-	   '--report-quiet' \
-	   '(--offline)-O[disable external queries]' \
-	   '(-O)--offline' \
-	   '(--query-bts --no-query-bts)-b[do not query BTS]' \
-	   '(-b --query-bts)--no-query-bts' \
-	   '(-b --no-query-bts)--query-bts' \
-	   '(--tags)-T[add specified tags]:tags:' \
-	   '(-T)--tags=:tags:' \
-	   '(-p)--print[print to stdout instead of mail]' \
-	   '(-m)--maintonly' \
-	   '(-d)--debug' \
-	   '--version' \
-	   '--license' \
-           "$_bug_commonargs[@]" \
-	   "$_rb_commonargs[@]"
-;;
-
-querybts)
-_arguments '(--web)-w[launch external web browser]' \
-           '(-w)--web' \
-	   '(--archive)-A[browse archived bugs]' \
-	   '(-A)--archive' \
-	   '(--source)-s[query for source packages rather than binary]' \
-	   '(-s)--source' \
-	   '(--version)-v[show version]' \
-	   '(-v)--version' \
-           "$_rb_commonargs[@]" \
-           '*:package:_deb_packages avail'
-
+  bug)
+    _arguments \
+      '-c[exclude configs from report]' \
+      '-f[argument is a file, not a package]' \
+      '-H[special header]:custom header:' \
+      '-q[quiet - no e-mail forwarding]' \
+      '-s[set subject]:subject:' \
+      '-S[set severity]:severity:(wishlist normal important serious grave critical)' \
+      '-v[version]' \
+      '-x[do not cc submitter]' \
+      '-z[send configs verbatim]' \
+      "$_bug_commonargs[@]"
+  ;;
+  reportbug)
+    _arguments \
+      '(-c --no-config-files)'{-c,--no-config-files}'[exclude configs from report]' \
+      '(-f --filename)'{-f,--filename=}'[argument is a file, not a package]:filename:_files' \
+      '(-H --header)'{-H,--header=}'[special header]:custom header' \
+      '(-s --subject)'{-s,--subject=}'[set subject]:subject' \
+      '(-S --severity)'{-S,--severity=}'[set severity]:severity:(wishlist normal important serious grave critical)' \
+      '(-x --no-cc)'{-x,--no-cc}'[do not cc submitter]' \
+      '(-z --no-compress)'{-z,--no-compress}'[send configs verbatim]' \
+      '(-a --af)'{-a,--af}'[use af instead of editor]' \
+      '(-b --no-bts-query)'{-b,--no-bts-query}'[do not check bts]' \
+      '(-g --gpg --gnupg)'{-g,--gpg,--gnupg}'[sign report with GnuPG]' \
+      '(-i --include)'{-i,--include}'[include text]:include file:_files' \
+      '(-A --attach)'{-A,--attach=}'[attach file]:attachment:_files' \
+      '(-M --mutt)'{-M,--mutt}'[use mutt instead of editor]' \
+      '(-G --gnus)'{-G,--gnus}'[use GNUS instead of editor]' \
+      '(-e --editor)'{-e,--editor=}'[use specified editor instead of editor]:editor' \
+      '--mua=[use specified mua instead of editor]' \
+      '--mta=[use specified mta]' \
+      '(-n --nmh --mh)'{-n,--nmh,--mh}'[use comp instead of editor]' \
+      '(-o --output)'{-o,--output=}'[output to file instead of mail]:output file:_files' \
+      '(-P --pgp)'{-P,--pgp}'[sign report with PGP]' \
+      '(-C --class)'{-C,--class=}':GNATS report class' \
+      '--realname=:real name' \
+      '(--replyto)--reply-to=' \
+      '(--reply-to)--replyto=' \
+      '--email=:originating address:_email_addresses' \
+      '--smtphost=:SMTP server:_hosts' \
+      '(-p --print)'{-p,--print}'[print to stdout instead of mail]' \
+      '(-q --quiet)'{-q,--quiet}'[reduce verbosity of output]' \
+      '(--no-query-source)--query-source' \
+      '(--query-source)--no-query-source' \
+      '(--no-debconf)--debconf' \
+      '(--debconf)--no-debconf' \
+      '(-Q --query-only)'{-Q,--query-only}'[do not submit]' \
+      '(-j --justification)'{-j,--justification=}':justification' \
+      '(-V --package-version)'{-V,--package-version=}':package version' \
+      '(-u --interface)'{-u,--interface=}':user interface' \
+      '(-t --type)'{-t,--type=}':type of report' \
+      '--template[output a template report only]' \
+      '--configure[reconfigure reportbug for this user]' \
+      '(--no-check-available)--check-available' \
+      '(--check-available)--no-check-available' \
+      '--mode=' \
+      '(-v --verify --no-verify)'{-v,--verify}'[verify integrity with debsums]' \
+      '(--verify -v)--no-verify' \
+      '(-k --kudos)'{-k,--kudos}'[send appreciative email to maintainer]' \
+      '--mirror=:BTS mirror:_hosts' \
+      '--list-cc=:carbon copy:' \
+      '--report-quiet' \
+      '(-O --offline)'{-O,--offline}'[disable external queries]' \
+      '(-n --no-query-bts --query-bts)'{-b,--no-query-bts}'[do not query BTS]' \
+      '(-b --no-query-bts)--query-bts' \
+      '(-T --tags)'{-T,--tags=}'[add specified tags]:tags' \
+      '(-m)--maintonly' \
+      '(-d)--debug' \
+      '--version' \
+      '--license' \
+      "$_bug_commonargs[@]" \
+      "$_rb_commonargs[@]"
+  ;;
+  querybts)
+    _arguments \
+      '(-w --web)'{-w,--web}'[launch external web browser]' \
+      '(-A --archive)'{-A,--archive}'[browse archived bugs]' \
+      '(-s --source)'{-s,--source}'[query for source packages rather than binary]' \
+      '(-v --version)'{-v,--version}'[show version]' \
+      "$_rb_commonargs[@]" \
+      '*:package:_deb_packages avail'
+  ;;
 esac
diff --git a/Completion/Debian/Command/_debchange b/Completion/Debian/Command/_debchange
index 689329370..960194ce7 100644
--- a/Completion/Debian/Command/_debchange
+++ b/Completion/Debian/Command/_debchange
@@ -1,15 +1,10 @@
 #compdef debchange dch=debchange
 
 _arguments \
-    '(--help)-h[help]' \
-    '(-h)--help' \
-    '--version' \
-    '(--append -a --newversion -v --increment)-i[increment]' \
-    '(--append -a --newversion -v -i)--increment' \
-    '(--increment -i --newversion -v --append)-a[append]' \
-    '(--increment -i --newversion -v -a)--append' \
-    '(--append -a --increment -i --newversion)-v[newversion]:version:' \
-    '(--append -a --increment -i -v)--newversion:version:' \
-    '(--preserve)-p[preserve]' \
-    '(-p)--preserve' \
-    ':text:'
+  '(-h --help)'{-h,--help}'[display help information]' \
+  '--version' \
+  '(--append -a --newversion -v --increment -i)'{-i,--increment}'[increment release or version number]' \
+  '(--append -a --newversion -v --increment -i)'{-a,--append}'[add new changelog entry]' \
+  '(--append -a --newversion -v --increment -i)'{-v,--newversion}'[specify new version number]:version:' \
+  '(--preserve -p)'{-p,--preserve}'[preserve source tree directory name]' \
+  ':text:'
diff --git a/Completion/Debian/Command/_debfoster b/Completion/Debian/Command/_debfoster
index 8f7f1b082..154d0e913 100644
--- a/Completion/Debian/Command/_debfoster
+++ b/Completion/Debian/Command/_debfoster
@@ -1,93 +1,68 @@
 #compdef debfoster
 
-_arguments \
-'(--verbose)-v[be a loudmouth]' \
-'(-v)--verbose[be a loudmouth]' \
-'(--version)-V[show version and copyright information]' \
-'(-V)--version[show version and copyright information]' \
-'(--help)-h[show this message]' \
-'(-h)--help[show this message]' \
-'(--quiet)-q[silently build keeper file]' \
-'(-q)--quiet[silently build keeper file]' \
-'(--force)-f[force system to conform to keeper file]' \
-'(-f)--force[force system to conform to keeper file]' \
-'(--mark-only)-m[do not install or delete packages]' \
-'(-m)--mark-only[do not install or delete packages]' \
-'(--upgrade)-u[try to upgrade dependencies]' \
-'(-u)--upgrade[try to upgrade dependencies]' \
-'(--config FILE)-c[specify configuration file]' \
-'(-c)--config FILE[specify configuration file]' \
-'(--keeperfile FILE)-k[specify keeper file]' \
-'(-k)--keeperfile FILE[specify keeper file]' \
-'(--no-keeperfile)-n[do not read keeper file]' \
-'(-n)--no-keeperfile[do not read keeper file]' \
-'(--ignore-default-rules)-i[ignore default rules]' \
-'(-i)--ignore-default-rules[ignore default rules]' \
-'(--show-keepers)-a[show packages on keeper list]' \
-'(-a)--show-keepers[show packages on keeper list]' \
-'(--show-orphans)-s[show orphaned packages]' \
-'(-s)--show-orphans[show orphaned packages]' \
-'(--show-depends)-d[show all depends of PACKAGE]:package:_deb_packages avail'   \
-'(-d)--show-depends[show all depends of PACKAGE]:package:_deb_packages avail'   \
-'(--show-dependents)-e[show dependents of PACKAGE]:package:_deb_packages avail' \
-'(-e)--show-dependents[show dependents of PACKAGE]:package:_deb_packages avail' \
-'(--show-providers)-p[show packages providing PACKAGE]:package:_deb_packages avail' \
-'(-p)--show-providers[show packages providing PACKAGE]:package:_deb_packages avail' \
-'(--show-related)-r[show packages brought in by PACKAGE]:package:_deb_packages avail' \
-'(-r)--show-related[show packages brought in by PACKAGE]:package:_deb_packages avail' \
-'(--use-tasks)-t[make tasks visible as packages]' \
-'(-t)--use-tasks[make tasks visible as packages]' \
-'*-'{-option,o}'[override any configuration option]:option string:->option' \
-'*:package markings: _alternative "installed:installed packages:_deb_packages -S- installed" "uninstalled:uninstalled packages:_deb_packages uninstalled"' \
-&& return 0
+local curcontext="$curcontext" state line expl ret=1
 
-ret=1
+_arguments -C \
+  '(-v --verbose)'{-v,--verbose}'[be a loudmouth]' \
+  '(-V --version)'{-V,--versuib}'[show version and copyright information]' \
+  '(-h --help)'{-h,--help}'[show help information]' \
+  '(-q --quiet)'{-q,--quiet}'[silently build keeper file]' \
+  '(-f --force)'{-f,--force}'[force system to conform to keeper file]' \
+  '(-m --mark-only)'{-m,--mark-only}'[do not install or delete packages]' \
+  '(-u --upgrade)'{-u,--upgrade}'[try to upgrade dependencies]' \
+  '(-c --config)'{-c,--config}'[specify configuration file]:file:_files' \
+  '(-k --keeperfile)'{-k,--keeperfile}'[specify keeper file]:file:_files' \
+  '(-n --no-keeperfile)'{-n,--no-keeperfile}'[do not read keeper file]' \
+  '(-i --ignore-default-rules)'{-i,--ignore-default-rules}'[ignore default rules]' \
+  '(-a --show-keepers)'{-a,--show-keepers}'[show packages on keeper list]' \
+  '(-s --show-orphans)'{-s,--show-orphans}'[show orphaned packages]' \
+  '(-d --show-depends)'{-d,--show-depends}'[show all depends of specified package]:package:_deb_packages avail'   \
+  '(-e --show-dependents)'{-e,--show-dependents}'[show dependents of specified package]:package:_deb_packages avail' \
+  '(-p --show-providers)'{-p,--show-providers}'[show packages providing specified package]:package:_deb_packages avail' \
+  '(-r --show-related)'{-r,--show-related}'[show packages brought in by specified package]:package:_deb_packages avail' \
+  '(-t --use-tasks)'{-t,--use-tasks}'[make tasks visible as packages]' \
+  '*-'{-option,o}'[override any configuration option]:option string:->option' \
+  '*:package markings: _alternative "installed:installed packages:_deb_packages -S- installed" "uninstalled:uninstalled packages:_deb_packages uninstalled"' \
+  && ret=0
 
-while [[ -n "$state" ]]; do
-      lstate="$state"
-      state=''
-
-      case "$lstate" in
-      option)
-        if compset -P '*='; then
-          case "$IPREFIX" in
-          *(#i)(install|remove|info)cmd*)
-            _wanted values expl 'command string' _command && ret=0
-            ;;
-	  *(#i)(keeperfile|dpkg(status|available))*)
-	    _wanted values expl 'metadata file' _files && ret=0
-	    ;;
-	  *(#i)maxpriority*)
-	    _wanted values expl 'package priority' \
-	      compadd required important standard optional extra ANY && ret=0
-	    ;;
-          *(#i)(use(hold|essential|predepends|recommends|suggests|tasks)|negativekeepers|verbose|force|quiet)*)
-            _wanted values expl 'truth value' \
-              compadd yes no && ret=0
-            ;;
-	  *(#i)(no|)keepsections*)
-            _wanted values expl 'section' \
-	      compadd x11 web utils text tex sound shells science \
-	       otherosfs oldlibs news net misc math mail libs \
-	       interpreters hamradio graphics games electronics \
-	       editors doc devel comm base admin && ret=0
-	    ;;
-	  *(#i)guessdepends*)
-            _wanted values expl 'name extension' \
-	      compadd doc dev && ret=0
-	    ;;
-	  esac
-	else
-          _wanted values expl 'configure file option' \
-              compadd -M 'm:{a-z}={A-Z}' -S '=' - \
-                  InstallCmd RemoveCmd InfoCmd KeeperFile DpkgStatus \
-                  DpkgAvailable MaxPriority UseHold UseEssential \
-                  UsePreDepends UseRecommends UseSuggests UseTasks \
-                  KeepSections NokeepSections GuessDepends NegativeKeepers \
-		  Verbose Force Quiet && ret=0
-        fi
-        ;;
-      esac
-done
+if [[ -n "$state" ]]; then
+  if compset -P '*='; then
+    case "$IPREFIX" in
+    *(#i)(install|remove|info)cmd*)
+      _wanted values expl 'command string' _command && ret=0
+      ;;
+    *(#i)(keeperfile|dpkg(status|available))*)
+      _wanted values expl 'metadata file' _files && ret=0
+      ;;
+    *(#i)maxpriority*)
+      _wanted values expl 'package priority' \
+	compadd required important standard optional extra ANY && ret=0
+      ;;
+    *(#i)(use(hold|essential|predepends|recommends|suggests|tasks)|negativekeepers|verbose|force|quiet)*)
+      _wanted values expl 'truth value' \
+	compadd yes no && ret=0
+      ;;
+    *(#i)(no|)keepsections*)
+      _wanted values expl 'section' compadd \
+	  x11 web utils text tex sound shells science \
+	  otherosfs oldlibs news net misc math mail libs \
+	  interpreters hamradio graphics games electronics \
+	  editors doc devel comm base admin && ret=0
+      ;;
+    *(#i)guessdepends*)
+      _wanted values expl 'name extension' \
+	  compadd doc dev && ret=0
+      ;;
+    esac
+  else
+    _wanted values expl 'configure file option' \
+	compadd -M 'm:{a-z}={A-Z}' -S '=' - \
+	    InstallCmd RemoveCmd InfoCmd KeeperFile DpkgStatus \
+	    DpkgAvailable MaxPriority UseHold UseEssential \
+	    UsePreDepends UseRecommends UseSuggests UseTasks \
+	    KeepSections NokeepSections GuessDepends NegativeKeepers \
+	    Verbose Force Quiet && ret=0
+  fi
+fi
 
 return ret
diff --git a/Completion/Debian/Command/_debsign b/Completion/Debian/Command/_debsign
index c706cb1c3..cd8c96dad 100644
--- a/Completion/Debian/Command/_debsign
+++ b/Completion/Debian/Command/_debsign
@@ -1,14 +1,15 @@
 #compdef debsign
 
-_arguments '-r[copy .changes file from remote host]:[username@]remotehost' \
-           '-p[program with which to sign]:program name' \
-           '-m[maintainer]:maintainer name and email address' \
-           '-e[maintainer]:maintainer name and email address' \
-           '-k[key ID to use for signing]:keyid' \
-           '-s[argument style for signing program]:gpg or pgp' \
-           '-S[look for source-only .changes file]' \
-           '-a[architecture]:Debian architecture' \
-           '-t[GNU system type]:GNU system type' \
-           '--help[help]' \
-           '--version[version]' \
-           '*:changes or dsc file:_files -g "*.(changes|dsc)"'
+_arguments \
+  '-r[copy .changes file from remote host]: :_user_at_host' \
+  '-p[program with which to sign]:program name' \
+  '-m[maintainer]:maintainer name and email address' \
+  '-e[maintainer]:maintainer name and email address' \
+  '-k[key ID to use for signing]:keyid' \
+  '-s[argument style for signing program]:gpg or pgp' \
+  '-S[look for source-only .changes file]' \
+  '-a[architecture]:Debian architecture' \
+  '-t[GNU system type]:GNU system type' \
+  '--help[display help information]' \
+  '--version[display version information]' \
+  '*:changes or dsc file:_files -g "*.(changes|dsc)"'
diff --git a/Completion/Debian/Command/_dpkg b/Completion/Debian/Command/_dpkg
index d8b5d9327..406428d97 100644
--- a/Completion/Debian/Command/_dpkg
+++ b/Completion/Debian/Command/_dpkg
@@ -1,4 +1,4 @@
-#compdef dpkg dpkg-deb
+#compdef dpkg dpkg-deb dpkg-reconfigure
 
 local _dpkg_deb_actions _dpkg_common_actions _dpkg_actions _dpkg_options
 local _dpkg_options_recursive _dpkg_actions_install _dpkg_actions_record_avail
@@ -73,63 +73,72 @@ _dpkg_options_recursive=( '(--recursive -R)'{--recursive,-R}'[recursive]' )
 #  _dpkg_actions_record_avail=('(--record-avail)-A[record available]' '(-A)--record-avail')
 
 case "$service" in
-dpkg)
-_arguments -C -s "$_dpkg_actions[@]" \
-           "$_dpkg_deb_actions[@]" \
-           "$_dpkg_common_actions[@]" \
-           "$_dpkg_options[@]" \
-	   "$_dpkg_options_recursive[@]" && return 0
-;;
-
-dpkg-deb)
-_arguments "$_dpkg_deb_actions[@]" \
-           "$_dpkg_common_actions[@]" && return 0
-
-;;
+  dpkg)
+    _arguments -C -s \
+      "$_dpkg_actions[@]" \
+      "$_dpkg_deb_actions[@]" \
+      "$_dpkg_common_actions[@]" \
+      "$_dpkg_options[@]" \
+      "$_dpkg_options_recursive[@]" && return 0
+  ;;
 
+  dpkg-deb)
+    _arguments "$_dpkg_deb_actions[@]" \
+	"$_dpkg_common_actions[@]" && return 0
+  ;;
+  dpkg-reconfigure)
+    _arguments -s \
+      '(-f --frontend)'{-f,--frontend}'[select frontend to use]:frontend' \
+      '(-p --priority)'{-p,--priority}'[specify min priority of questions]:priority' \
+      '--default-priority[use default question priority]' \
+      '(*)--all[reconfigure all installed packages using debconf]' \
+      '(-u --unseen-only)'{-u,--unseen-only}'[only ask questions not yet seen are asked]' \
+      '--force[reconfigure even packages in broken state]' \
+      '(-)'{-h,--help}'[display help information]' \
+      '*:package:_deb_packages installed' && return 0
+  ;;
 esac
 
 case "$state" in
   install|record_avail)
-	_call_function ret _dpkg_$state && return ret
+    _call_function ret _dpkg_$state && return ret
 # not needed anymore?
 #            "${(@e):-\$_dpkg_actions_${state}}" \
-	_arguments -C -A '-*' -s \
-             "$_dpkg_options[@]" \
-             \!${^_dpkg_actions%%:*} \
-	   - recur \
-             "$_dpkg_options_recursive[@]" \
-	     '*:directory:_path_files -/' \
-	   - nonrecur \
-	     '*:Debian package:_path_files -g \*.deb'
+    _arguments -C -A '-*' -s \
+	"$_dpkg_options[@]" \
+	\!${^_dpkg_actions%%:*} \
+      - recur \
+	"$_dpkg_options_recursive[@]" \
+	'*:directory:_path_files -/' \
+      - nonrecur \
+	'*:Debian package:_path_files -g \*.deb'
   ;;
   remove|purge|status|listfiles)
-	_call_function ret _dpkg_$state && return ret
-	_arguments -C -A "-*" -s "$_dpkg_options[@]" \
-	   '*:package:_deb_packages installed'
+    _call_function ret _dpkg_$state && return ret
+    _arguments -C -A "-*" -s "$_dpkg_options[@]" \
+       '*:package:_deb_packages installed'
   ;;
   list)
-	_call_function ret _dpkg_$state && return ret
-	_arguments -C -A "-*" -s "$_dpkg_options[@]" \
-           '*:packages:_deb_packages avail'
+    _call_function ret _dpkg_$state && return ret
+    _arguments -C -A "-*" -s "$_dpkg_options[@]" \
+       '*:packages:_deb_packages avail'
   ;;
   compare_versions)
-	_call_function ret _dpkg_$state && return ret
-	_arguments -C -A "-*" -s \
-	'1:version A:' \
-	'2:operator:(lt le eq ne ge gt lt-nl le-nl ge-nl gt-nl)' \
-	'3:version B:'
+    _call_function ret _dpkg_$state && return ret
+    _arguments -C -A "-*" -s \
+    '1:version A:' \
+    '2:operator:(lt le eq ne ge gt lt-nl le-nl ge-nl gt-nl)' \
+    '3:version B:'
   ;;
   configure)
-	_call_function ret _dpkg_$state && return ret
-	_arguments -C -A "-*" -s '--configure' \
-	   "$_dpkg_options[@]" \
-	  '(* --pending)-a[pending packages]' \
-	  '(* -a)--pending' \
-	  '*:package:_deb_packages installed'
+    _call_function ret _dpkg_$state && return ret
+    _arguments -C -A "-*" -s '--configure' \
+       "$_dpkg_options[@]" \
+      '(* -a --pending)'{-a,--pending}'[pending packages]' \
+      '*:package:_deb_packages installed'
   ;;
   search)
-	_call_function ret _dpkg_$state && return ret
-	_files
+    _call_function ret _dpkg_$state && return ret
+    _files
   ;;
 esac
diff --git a/Completion/Debian/Command/_dpkg_source b/Completion/Debian/Command/_dpkg_source
index 7ae6e6ea4..274a85794 100644
--- a/Completion/Debian/Command/_dpkg_source
+++ b/Completion/Debian/Command/_dpkg_source
@@ -1,27 +1,28 @@
 #compdef dpkg-source
 
-_arguments '-x[specify source file]:Debian source file:_files -g \*.dsc' \
-           '-b[specify source directory]:Debian source directory:_files -/' \
-           '-c-[control file]:control file:_files' \
-           '-l-[changelog file]:changelog file:_files' \
-           '-F-[changelog format]:changelog format:' \
-           '-V-[set substitutions variable]:expression:' \
-           '-T-[alternate variable file]:varlistfile:' \
-           '-D-[override dsc field]:expression:' \
-           '-U-[remove a field]:field:' \
-           '-i-[ignore files in diff]:filter:' \
-           '-sa[autoselect orig source]' \
-           '-sk[use packaged orig source - unpack and keep]' \
-           '-sp[use packaged orig source - unpack and remove]' \
-           '-su[use unpackaged orig source - unpack and keep]' \
-           '-sr[use unpackaged orig source - unpack and remove]' \
-           '-ss[trust packed and unpacked source are the same]' \
-           '-sn[no diff, do main tarfile only]' \
-           '-sA[autoselect orig source with overwrite]' \
-           '-sK[use packaged orig source - unpack and keep with overwrite]' \
-           '-sP[use packaged orig source - unpack and remove with overwrite]' \
-           '-sU[use unpackaged orig source - unpack and keep with overwrite]' \
-           '-sR[use unpackaged orig source - unpack and remove with overwrite]' \
-           '-sp[leave original source packed in cwd]' \
-           '-su[unpack original source tree too]' \
-           '-h[help]'
+_arguments \
+  '-x[specify source file]:Debian source file:_files -g \*.dsc' \
+  '-b[specify source directory]:Debian source directory:_files -/' \
+  '-c-[control file]:control file:_files' \
+  '-l-[changelog file]:changelog file:_files' \
+  '-F-[changelog format]:changelog format:' \
+  '-V-[set substitutions variable]:expression:' \
+  '-T-[alternate variable file]:varlistfile:' \
+  '-D-[override dsc field]:expression:' \
+  '-U-[remove a field]:field:' \
+  '-i-[ignore files in diff]:filter:' \
+  '-sa[autoselect orig source]' \
+  '-sk[use packaged orig source - unpack and keep]' \
+  '-sp[use packaged orig source - unpack and remove]' \
+  '-su[use unpackaged orig source - unpack and keep]' \
+  '-sr[use unpackaged orig source - unpack and remove]' \
+  '-ss[trust packed and unpacked source are the same]' \
+  '-sn[no diff, do main tarfile only]' \
+  '-sA[autoselect orig source with overwrite]' \
+  '-sK[use packaged orig source - unpack and keep with overwrite]' \
+  '-sP[use packaged orig source - unpack and remove with overwrite]' \
+  '-sU[use unpackaged orig source - unpack and keep with overwrite]' \
+  '-sR[use unpackaged orig source - unpack and remove with overwrite]' \
+  '-sp[leave original source packed in cwd]' \
+  '-su[unpack original source tree too]' \
+  '-h[help]'
diff --git a/Completion/Debian/Command/_dput b/Completion/Debian/Command/_dput
index 5fe9847d1..64b682c6f 100644
--- a/Completion/Debian/Command/_dput
+++ b/Completion/Debian/Command/_dput
@@ -1,27 +1,14 @@
 #compdef dput
 
-if (( ! $+_dput_sites )); then
-  _dput_sites=( ${${(M)${(f)"$(</etc/dput.cf)"}:#\[*}//[][]/} )
-fi
-
-_arguments '(-c)--config[config file]:config file:' \
-           '(--config)-c[config file]:config file:' \
-           '(--debug)-d[debug mode]' \
-           '(-d)--debug[debug mode]' \
-           '(--dinstall)-D[run dinstall after upload]' \
-           '(-D)--dinstall[run dinstall after upload]' \
-           '(--force)-f[force upload of already uploaded package]' \
-           '(-f)--force[force upload of already uploaded package]' \
-           '(--lintian)-l[run lintian before upload]' \
-           '(-l)--lintian[run lintian before upload]' \
-           '(-o)--check-only[check the package, do not upload]' \
-           '(--check-only)-o[check the package, do not upload]' \
-           '(--print)-p[print configuration]' \
-           '(-p)--print[print configuration]' \
-           '(--simulate)-s[simulate an upload only]' \
-           '(-s)--simulate[simulate an upload only]' \
-           '(--unchecked)-u[do not check GPG signature on the changes file]' \
-           '(-u)--unchecked[do not check GPG signature on the changes file]' \
-           '(-v)--version[version]' \
-           '(--version)-v[version]' \
-           '*:changes file:_files -g \*.changes' \
+_arguments \
+  '(-c --config)'{-c,--config}'[specify config file]:config file:_files' \
+  '(-d --debug)'{-d,--debug}'[debug mode]' \
+  '(-D --dinstall)'{-D,--dinstall}'[run dinstall after upload]' \
+  '(-f --force)'{-f,--force}'[force upload of already uploaded package]' \
+  '(-l --lintian)'{-l,--lintian}'[run lintian before upload]' \
+  '(-o --check-only)'{-o,--check-only}'[check the package, do not upload]' \
+  '(-p --print)'{-p,--print}'[print configuration]' \
+  '(-s --simulate)'{-s,--simulare}'[simulate an upload only]' \
+  '(-u --unchecked)'{-u,--unchecked}'[do not check GPG signature on the changes file]' \
+  '(-v --version)'{-v,--version}'[show version information]' \
+  '*:changes file:_files -g \*.changes'
diff --git a/Completion/Debian/Command/_dupload b/Completion/Debian/Command/_dupload
index 81ac73f67..4ec179688 100644
--- a/Completion/Debian/Command/_dupload
+++ b/Completion/Debian/Command/_dupload
@@ -2,25 +2,20 @@
 
 if (( ! $+_dupload_sites )); then
   _dupload_sites=(
-$(grep -hs "^\$cfg" /etc/dupload.conf ~/.dupload.conf | sed 's/^\$cfg{\([^}]*\)}.*$/\1/')
-)
+    $(grep -hs "^\$cfg" /etc/dupload.conf ~/.dupload.conf | sed 's/^\$cfg{\([^}]*\)}.*$/\1/')
+  )
 fi
 
-_arguments '--to:nickname[nickname of target site]:('"$_dupload_sites"')' \
-           '(--debug)-d[ftp verbosity]:debuglevel:' \
-           '(-d)--debug[ftp verbosity]:debuglevel:' \
-           '(--force)-f[upload ignoring logs]' \
-           '(-f)--force[upload ignoring logs]' \
-           '(--keep)-k[keep going, skip broken]' \
-           '(-k)--keep[keep going, skip broken]' \
-           '--no[dry run]' \
-           '--nomail[suppress announcement]' \
-           '--mailonly[dry run and real announcement]' \
-           '--noarchive[add anti-archival header]' \
-           '(--print)-p[print config legibly]' \
-           '(-p)--print[print config legibly]' \
-           '(--quiet)-q[quiet]' \
-           '(-q)--quiet[quiet]' \
-           '(--Version)-V[version]' \
-           '(-V)--Version[version]' \
-           '*:changes file:_files -g \*.changes' \
+_arguments \
+  '--to:nickname[nickname of target site]:('"$_dupload_sites"')' \
+  '(-d --debug)'{-d,--debug}'[ftp verbosity]:debuglevel:' \
+  '(-f --force)'{-f,--force}'[upload ignoring logs]' \
+  '(-k --keep)'{-k,--keep}'[keep going, skip broken]' \
+  '--no[dry run]' \
+  '--nomail[suppress announcement]' \
+  '--mailonly[dry run and real announcement]' \
+  '--noarchive[add anti-archival header]' \
+  '(-p --print)'{-p,--print}'[print config legibly]' \
+  '(-q --quiet)'{-q,--quiet}'[quiet]' \
+  '(-V --Version)'{-V,--Version}'[display version information]' \
+  '*:changes file:_files -g \*.changes'
diff --git a/Completion/Debian/Command/_update-alternatives b/Completion/Debian/Command/_update-alternatives
index eaeb300b8..dd1d4fce3 100644
--- a/Completion/Debian/Command/_update-alternatives
+++ b/Completion/Debian/Command/_update-alternatives
@@ -1,60 +1,59 @@
 #compdef update-alternatives
 
-local curcontext="$curcontext" context state line expl ret alterdir
-typeset -A opt_args
+local curcontext="$curcontext" context state line alterdir
 
-if [[ -d /var/lib/dpkg/alternatives ]];then
-    alterdir=/var/lib/dpkg/alternatives
-elif [[ -d /var/lib/rpm/alternatives/ ]];then
-    alterdir=/var/lib/rpm/alternatives
+if [[ -d /var/lib/dpkg/alternatives ]]; then
+  alterdir=/var/lib/dpkg/alternatives
+elif [[ -d /var/lib/rpm/alternatives/ ]]; then
+  alterdir=/var/lib/rpm/alternatives
 fi
 
-_arguments -C '--verbose' \
-           '--quiet' \
-           '--test' \
-           '--help' \
-           '--version' \
-           '--altdir:altdir:_files -/' \
-           '--admindir:admindir:_files -/' \
-    '--install:*::alt:= ->install' \
-    '--remove:*::alt:= ->remove' \
-    '--auto:name:_files -W $alterdir' \
-    '--display:name:_files -W $alterdir' \
-    '--config:name:_files -W $alterdir' && return 0
+_arguments -C \
+  '--verbose' \
+  '--quiet' \
+  '--test' \
+  '--help' \
+  '--version' \
+  '--altdir:altdir:_files -/' \
+  '--admindir:admindir:_files -/' \
+  '--install:*::alt:= ->install' \
+  '--remove:*::alt:= ->remove' \
+  '--auto:name:_files -W $alterdir' \
+  '--display:name:_files -W $alterdir' \
+  '--config:name:_files -W $alterdir' && return
 
 while true; do
-case "$state" in
-	islave)
-        _call_function ret _update_alternatives_$state && return ret
-	state=
-	_arguments -C '1:link:_files' \
-                   '2:name:_files -W $alterdir' \
-                   '3:path:_files' \
-                   '--slave:*::more:= ->islave' && return 0
-        [[ -z $state ]] && return 1
-	;;
-
-	install)
-        _call_function ret _update_alternatives_$state && return ret
-	_arguments -C '1:link:_files' \
-                   '2:name:_files -W $alterdir' \
-                   '3:path:_files' \
-                   '4:priority:' \
-                   '--slave:*::slave:= ->islave' && return 0
-        [[ -z $state ]] && return 1
-	;;
-
-	remove)
-        _call_function ret _update_alternatives_$state && return ret
-	_arguments \
-                   '1:name:_files -W $alterdir' \
-                   '2:path:_files' && return 0
-        return 1
-	;;
-
-	*)
-	return 1
-	;;
-
-esac
+  case "$state" in
+    islave)
+      _call_function ret _update_alternatives_$state && return ret
+      state=
+      _arguments -C \
+	'1:link:_files' \
+	'2:name:_files -W $alterdir' \
+	'3:path:_files' \
+	'--slave:*::more:= ->islave' && return
+      [[ -z $state ]] && return 1
+    ;;
+
+    install)
+      _call_function ret _update_alternatives_$state && return ret
+      _arguments -C \
+	'1:link:_files' \
+	'2:name:_files -W $alterdir' \
+	'3:path:_files' \
+	'4:priority:' \
+	'--slave:*::slave:= ->islave' && return
+      [[ -z $state ]] && return 1
+    ;;
+
+    remove)
+      _call_function ret _update_alternatives_$state && return ret
+      _arguments \
+	'1:name:_files -W $alterdir' \
+	'2:path:_files'
+      return
+    ;;
+
+    *) return 1 ;;
+  esac
 done
diff --git a/Completion/Linux/Command/_iptables b/Completion/Linux/Command/_iptables
index af4d0c8b3..8f990030c 100644
--- a/Completion/Linux/Command/_iptables
+++ b/Completion/Linux/Command/_iptables
@@ -12,8 +12,8 @@ case $service in
   ;;
   iptables-restore)
     _arguments -s \
-      '{-c,--counters}'[restore the values of all packet and byte counters]' \
-      '{-n,--noflush}"[don't flush the previous contents of the table]"
+      {-c,--counters}'[restore the values of all packet and byte counters]' \
+      {-n,--noflush}"[don't flush the previous contents of the table]"
     return
   ;;
 esac
diff --git a/Completion/Linux/Command/_pkgtool b/Completion/Linux/Command/_pkgtool
index dd112680d..146467d36 100644
--- a/Completion/Linux/Command/_pkgtool
+++ b/Completion/Linux/Command/_pkgtool
@@ -1,84 +1,53 @@
 #compdef installpkg upgradepkg removepkg pkgtool explodepkg makepkg 
 
-_slackware_pkg() {
-  local flags
-
-  case "$service" in
+case "$service" in
   installpkg)
-    flags=(
-      '-warn[warn if files will be overwritten, but do not install]'
-      '-root=[install someplace else, like /mnt]:root directory:_path_files -/'
-      '-infobox[use dialog to draw an info box]'
-      '-menu[confirm package installation with a menu]'
-      '-ask[used with menu mode: always ask if a package should be installed regardless of what the package'\''s priority is]'
-      '-priority[provide a priority for the entire package list to use instead of the priority in the tagfile]:priority list:(ADD REC OPT SKP)'
-      '-tagfile[specify a different file to use for package priorities.  The default is "tagfile" in the package'\''s directory]:tagfile:_files -/'
-    )
-
-    _arguments -s \
-      $flags[@] \
-      '*:Slackware packages:_files -g \*.tgz'
-    ;;
+    _arguments \
+      '-warn[warn if files would be overwritten, but do not install]' \
+      '-root=[specify alternate install location]:root directory:_path_files -/' \
+      '-infobox[use dialog to draw an info box]' \
+      '-menu[confirm package installation with a menu]' \
+      "-ask[always ask on package installation regardless of package's priority]" \
+      '-priority[provide a priority for the entire package list to use]:priority list:(ADD REC OPT SKP)' \
+      '-tagfile[specify a different file to use for package priorities]:tagfile:_files -/' \
+      '*:package file:_files -g \*.tgz'
+  ;;
 
   removepkg)
-    flags=(
-      '-warn[generate  a  report  to  the  standard output about which files and directories would be removed, but does not actually remove the package.]'
-      '-preserve[if specified, the complete package subtree is reconstructed in /tmp/preserved_packages/packagename.]'
-      '-copy[construct a copy of the package under /tmp/preserved_packages/packagename, but don'\''t remove it.  (same effect as -warn -preserve)]'
-      '-keep[save the  intermediate  files  created  by  removepkg  (delete_list,  required_files,  uniq_list,  del_link_list,  required_links, required_list).  Mostly useful for debugging purposes.]'
-    )
-
-    _arguments -s \
-      $flags[@] \
-      '*:Package name:_files -W /var/log/packages/ -/'
-    ;;
+    _arguments \
+      '-warn[list which files & directories would be removed, skip actual removal]' \
+      '-preserve[reconstruct complete package subtree in /tmp/preserved_packages]' \
+      '-copy[construct a copy of the package in /tmp/preserved_packages]' \
+      '-keep[save the intermediate files created]' \
+      '*:package:_files -W /var/log/packages/ -/'
+  ;;
 
   upgradepkg)
-    flags=(
-      '--install-new[the behavior is modified to install new packages in addition to upgrading existing ones.]'
-      '--reinstall[upgrade all packages even if the same version is already installed.]'
-      '--verbose[show all the gory details of the upgrade.]'
-    )
-
-
-    _arguments -s \
-      $flags[@] \
-      '*:Slackware packages:_files -g \*.tgz'
-    ;;
+    _arguments \
+      '--install-new[install new packages in addition to upgrading existing ones]' \
+      '--reinstall[upgrade even when the same version is already installed]' \
+      '--verbose[show all the gory details of the upgrade]' \
+      '*:package file:_files -g \*.tgz'
+  ;;
 
-    
   explodepkg)
-    _arguments -s \
-    '*:Slackware packages:_files -g \*.tgz'
-    ;;
+    _wanted file expl 'package file' _files -g \*.tgz
+  ;;
 
   makepkg)
-    flags=(
-      '(--linkadd -l)'{--linkadd,-l}'[moves symlinks into doinst.sh: recommended]:answer:(y n)'
-      '(--chown -c)'{--chown,-c}'[resets all permissions to root:root 755 - not generally recommended]:answer:(y n)'
-    )
-
-
     _arguments -s \
-      $flags[@] 
-    ;;
-
-
+      '(--linkadd -l)'{--linkadd,-l}'[move symlinks into doinst.sh]:answer:(y n)' \
+      '(--chown -c)'{--chown,-c}'[reset all permissions to root:root 755]:answer:(y n)'
+  ;;
 
   pkgtool)
-    flags=(
-    '-sets[install the disk sets A, B, C. Seperate the disk set names by '\''#'\'' symbols.]'
-    '-source_mounted[when this flag is present, pkgtool will not attempt to unmount and remount the source device with each disk.]'
-    '-ignore_tagfile[when this flag is present, pkgtool will install every *.tgz package encountered no matter what the tagfiles say.]'
-    '-tagfile[this flag is used to specify from the command line which tagfile should be used for the installation.]:tagfile:_files -/'
-    '-source_dir[used  when installing multiple packages from disk sets. This is the directory in which the subdirectories for each disk are found.]:source directory:_path_files -/'
-    '-target_dir[the directory where the target root directory is located. This is '/' when installing on the hard drive, or typically '\''/mnt'\''  when installing from an install disk.]:target directory:_path_files -W -/'
-    '-source_device[the source device to install from. This is not used if you'\''ve provided the -source_mounted flag. It'\''s usually used when installing from floppy.]:source device:{compadd "$expl[@]" /dev/*}'
-    )
-    _arguments -s \
-      $flags[@] 
-      ;;
-  esac
-}
-
-_slackware_pkg "$@"
+    _arguments \
+      "-sets[install the disk sets A, B, C]" \
+      "(-source_device)-source_mounted[don't attempt to unmount and remount source device with each disk]" \
+      '-ignore_tagfile[install every package encountered regardless of tagfiles]' \
+      '-tagfile[specify tagfile to be used for the installation]:tagfile:_files -/' \
+      '-source_dir[specify directory containing each disk subdirectory]:source directory:_path_files -/' \
+      '-target_dir[specify directory where the target root directory is located]:target directory:_path_files -W -/' \
+      '(-source_mounted)-source_device[specify source device to install from]:source device:{compadd "$expl[@]" /dev/*}'
+  ;;
+esac
diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm
index 893545fbc..f274975fe 100644
--- a/Completion/Redhat/Command/_rpm
+++ b/Completion/Redhat/Command/_rpm
@@ -39,224 +39,269 @@
 #  relocate
 #    complete a `old=new' pair of paths
 
-# Used by `_arguments', made local here.
-
 _rpm () {
   local curcontext="$curcontext" state lstate line nm="$compstate[nmatches]"
   typeset -A opt_args
-  
-  state=''
-  
   local ret=1
-  local -a tmp expl commonopts packageopts
+  local -a tmp expl commonopts selectopts
+
   commonopts=(
-    '*-v[verbose mode]'
+    '(-v --verbose)--quiet[print as little as possible]'
+    '(--quiet)*'{-v,--verbose}'[verbose output]'
     '--rcfile:resource file:_files'
-    '--ftpproxy:FTP proxy server:_hosts'
-    '--ftpport:FTP port number:'
-    '--httpproxy:HTTP proxy server:_hosts'
-    '--httpport:HTTP port number:'
+    '--ftpproxy:ftp proxy server:_hosts'
+    '--ftpport:ftp port number'
+    '--httpproxy:http proxy server:_hosts'
+    '--httpport:http port number'
+    {-\?,--help}'[print help information]'
+    '--version[print version number]'
+    '--pipe:pipe command:->command' \
+  )
+
+  # package selection options of which only one can be used
+  selectopts=(
+    {-a,--all}'[query all packages]'
+    {-f,--file}'[query packages that own specified files]'
+    {-p,--package}'[query uninstalled packages]'
+    {-g,--group}'[query packages in one of specified groups]'
+    --fileid --hdrid --pkgid --tid --querybynumber
+    '--triggeredby'
+    '--whatprovides'
+    '--whatrequires'
   )
-  packageopts=(
-    '-a[query all packages]'
-    '-p[query uninstalled package file]:*:RPM package file:->package_file'
-    '-f[specify file to query owner of]:file:_files'
-    '--triggeredby:RPM package:->package'
-    '--whatprovides:RPM capability:->capability'
-    '--whatrequires:RPM capability:->capability'
+  sopts=${selectopts%\[*}\ --specfile
+  selectopts=(
+    "(* $sopts)"${selectopts[1,2]}
+    "($sopts)"${selectopts[3,-1]}
+    '(-a --all)*: :->package-select'
   )
+
   pathopts=(
-    '--root:RPM root directory:_files -/'
-    '--dbpath:RPM database path:_files -/'
+    '--root:rpm root directory:_files -/'
+    '--dbpath:rpm database path:_files -/'
   )
-  
-  # Do simple completions or get the first state.
-  
+
   _arguments -C -s \
-    '--help[print help message]' \
-    '--version[print version number]' \
     "${commonopts[@]}" \
-    '-q+[query mode]:*:query:->query' \
-    --{querytags,initdb,showrc} \
-    '--pipe:pipe command:_command_names -e' \
-    -{V,y}'[verify mode]:*:verify:->verify' \
-    '--verify[verify mode]:*:verify:->verify' \
+    {-q+,--query}'[query mode]:*:query:->query' \
+    '(-V -y --verify)'{-V+,-y+,--verify}'[verify mode]:*:verify:->verify' \
+    '--import:*:public key' \
+    '(-K --checksig)'{-K,--checksig}'[signature check mode]:*:sigcheck:->sigcheck' \
+    '(-i --install)'{-i+,--install}'[install mode]:*:install:->install' \
+    '(-U --upgrade)'{-U+,--upgrade}'[upgrade mode]:*:upgrade:->upgrade' \
+    '(-F --freshen)'{-F+,--freshen}'[freshen mode]:*:upgrade:->upgrade' \
+    '(-e --erase)'{-e+,--erase}'[uninstall mode]:*:uninstall:->uninstall' \
+    --{initdb,querytags,showrc} \
+    '--rebuilddb:*:rebuild:->rebuild' \
+    --{resign,addsign}':*:package:->package_file' \
     '--setperms[set file permissions]:*:package:->setattrs' \
     '--setugids[set file owner/group]:*:package:->setattrs' \
-    '(--install)-i+[install mode]:*:install:->install' \
-    '(-i)--install:*:install:->install' \
-    '(--upgrade)-U+[upgrade mode]:*:upgrade:->upgrade' \
-    '(-U)--upgrade:*:upgrade:->upgrade' \
-    '(--freshen)-F+[freshen mode]:*:upgrade:->upgrade' \
-    '(-F)--freshen:*:upgrade:->upgrade' \
-    '(--erase)-e+[uninstall mode]:*:uninstall:->uninstall' \
-    '(-e)--erase:*:uninstall:->uninstall' \
     '-b+[build mode (spec file)]:build stage:((p\:execute\ \%prep\ stage l\:do\ a\ list\ check c\:execute\ build\ stage i\:execute\ install\ stage b\:build\ a\ binary\ package a\:build\ binary\ and\ source\ packages)):*:build:->build_b' \
     '(-b)-t+[build mode (tar file)]:build stage:((p\:execute\ \%prep\ stage l\:do\ a\ list\ check c\:execute\ build\ stage i\:execute\ install\ stage b\:build\ a\ binary\ package a\:build\ binary\ and\ source\ packages)):*:build:->build_t' \
-    --{resign,addsign}':*:RPM package:->package_file' \
-    '--rmsource:*:spec file:->spec_file' \
-    --{rebuild,recompile}':*:Src RPM files:->package_src' \
-    '(--checksig)-K+[signature check mode]:*:sigcheck:->sigcheck' \
-    '(-K)--checksig:*:sigcheck:->sigcheck' \
-    '--rebuilddb:*:rebuild:->rebuild' && ret=0
-  
+    '--rmsource:*:spec file:->spec_files' \
+    --{rebuild,recompile}':*:source rpm file:->package_src' \
+    '--eval:macro:->macros' && ret=0
+
   # As long as we have a state name...
-  
+
   while [[ -n "$state" ]]; do
-  
+
     # First try to call a user-defined function.
-  
+
     _call_function ret _rpm_$state && return ret
-  
+
     # Copy the state and reset `state', to simplify the test above.
-  
+
     lstate="$state"
     state=''
     tmp=()
-  
+
     # Dispatch...
-  
+
     case "$lstate" in
     query)
-      # --dump requires on of -{l,c,d}
+      # --dump requires one of -{l,c,d}
       # --triggers requires --script
       _arguments -s \
-        -q "${commonopts[@]}" "${packageopts[@]}" "${pathopts[@]}" \
-        '--queryformat:RPM query format:->tags' \
-        '-i[display package information]' \
-        '--changelog[display change log]' \
-        '-l[display package file list]' \
-        '-s[show file states]' \
-        '-d[documentation files only]' \
-        '-c[configuration files only]' \
-        '--dump[show all information]' \
-        --provides \
-        -{R,-requires}'[list dependencies]' \
-        '--scripts[show (un)install scripts]' \
-        '--triggers[show trigger scripts]' \
-        '*:RPM package:->package_or_file' && ret=0
+	\!{-q,--query} "${commonopts[@]}" "${selectopts[@]}" "${pathopts[@]}" \
+	"($sopts)--specfile[query specified spec file as if it were a package]" \
+	'(-i --info)'{-i,--info}'[display package information]' \
+	'--changelog[display change log]' \
+	'(-s --state -l --list --filesbypkg)'{-l,--list}'[display package file list]' \
+	'(-s --state -l --list --filesbypkg)'{-s,--state}'[show file states]' \
+	'(-s --state -l --list)--filesbypkg[list files with package names]' \
+	{-d,--docfiles}'[documentation files only]' \
+	{-c,--configfiles}'[configuration files only]' \
+	'--dump[show all information]' \
+	'--provides[show capabilities provided]' \
+	\*--{qf,queryformat}'[specify format for package information]:rpm query format:->tags' \
+	-{R,-requires}'[list dependencies]' \
+	'--scripts[show (un)install scripts]' \
+	{--triggers,--triggerscripts}'[show trigger scripts]' && ret=0
       ;;
     setattrs)
-      _arguments -s --set{perm,ugids} "${packageopts[@]}" && ret = 0
+      _arguments -s --set{perm,ugids} "${selectopts[@]}" && ret = 0
       ;;
     verify)
-      _arguments -s \
-        '(-y --verify)-V' '(-V --verify)-y' '(-y -V)--verify' \
-        "${commonopts[@]}" "${packageopts[@]}" "${pathopts[@]}" \
-        --no{deps,md5,files} \
-        '*:RPM package:->package_or_file' && ret=0
+      _arguments -s \!-{y,V} \
+	"${commonopts[@]}" "${selectopts[@]}" "${pathopts[@]}" \
+	--no{deps,files,scripts,digest,signature,linkto,md5,size,user,group,mtime,mode,rdev} && ret=0
       ;;
     upgrade)
-      tmp=( '(--upgrade)-U' '(-U)--upgrade' '(--force)--oldpackage' )
+      tmp=( '(--force)--oldpackage' )
       ;&
     install)
-      (( $#tmp )) || tmp=( '(--install)-i' '(-i)--install' )
-      _arguments -s "$tmp[@]" \
-        "${commonopts[@]}" "${pathopts[@]}" \
-        '--excludepath:exclude files in following path:_files -/' \
-        '--relocate:relocate:->relocate' \
-        '--prefix:package prefix directory:_files -/' \
-        '(-h)--hash' '(--hash)-h' \
-        '(--replacepkgs --replacefiles --oldpackage)--force' \
-        '(--force)--'{replacefiles,replacepkgs} \
-        --{badreloc,excludedocs,allfiles,ignorearch,ignoreos,includedocs,justdb,nodeps,noorder,noscripts,notriggers,percent,test} \
-        '*:pkg file:->package_file' && ret=0
+      _arguments -s \!-{i,U} "$tmp[@]" \
+	"${commonopts[@]}" "${pathopts[@]}" \
+	'--excludepath:file to exclude:_files -/' \
+	'--relocate:relocate:->relocate' \
+	'--prefix:package prefix directory:_files -/' \
+	'(-h --hash)'{-h,--hash} \
+	'(--replacepkgs --replacefiles --oldpackage)--force' \
+	'(--force)--'{replacefiles,replacepkgs} \
+	--{aid,allfiles,badreloc,excludedocs,ignorearch,ignoreos,ignoresize,includedocs,justdb,percent,repackage,test} \
+	--np{digest,signature,deps,suggest,order,pre,post,preun,postun,trigger{s,in,un,postun}} \
+	'(--nopre --nopost --nopreun --nopostun)--noscripts' \
+	'*:pkg file:->package_file' && ret=0
       ;;
     uninstall)
-      _arguments -s \
-        '(-e)--erase' '(--erase)-e' \
-        "${commonopts[@]}" "${pathopts[@]}" \
-        --{allmatches,justdb,nodeps,noorder,noscripts,notriggers} \
-        '*:RPM package:->package' && ret=0
+      _arguments -s \!-e \
+	"${commonopts[@]}" "${pathopts[@]}" \
+	--{allmatches,justdb,repackage,test} \
+	--no{deps,scripts,preun,postun,trigger{s,un,postun}} \
+	'*:package:->package' && ret=0
       ;;
     build_b)
       tmp=( '*:spec file:_files -g \*.spec' )
       ;&
     build_t)
       (( $#tmp )) || tmp=( '*:tar file:_files -g \*.\(\#i\)tar\(.\*\|\)' )
-  
+
       _arguments -s \
-        "${commonopts[@]}" "${pathopts[@]}" \
-        --{short-circuit,clean,nobuild,rmsource,sign,test} \
-        '--target:specify a build target:->target'\
-        '--buildroot:build root directory:_files -/' \
-        '--buildarch:architecture for which to build:->target' \
-        '--buildos:operating system for which to build:' \
-        '--timecheck:time check (seconds):' "$tmp[1]" && ret=0
+	"${commonopts[@]}" "${pathopts[@]}" \
+	--{short-circuit,clean,nobuild,rmsource,sign,test} \
+	'--target:specify a build target:->target'\
+	'--buildroot:build root directory:_files -/' \
+	'--buildarch:architecture for which to build:->target' \
+	'--buildos:operating system for which to build:' \
+	'--timecheck:time check (seconds):' "$tmp[1]" && ret=0
       ;;
     sigcheck)
-      _arguments -s \
-        '(-K)--checksig' '(--checksig)-K' \
-        "${commonopts[@]}" \
-        --no{gpg,pgp,md5} \
-        '*:RPM package file:->package_file' && ret=0
+      _arguments -s \!-K \
+	"${commonopts[@]}" \
+	--no{gpg,pgp,md5,signature,digest} \
+	'*:package file:->package_file' && ret=0
       ;;
     rebuild)
       _arguments -s \
-        "${commonopts[@]}" "${pathopts[@]}" \
-        '*:RPM source package file:->package_file' && ret=0
+	"${commonopts[@]}" "${pathopts[@]}" \
+	'*:source package file:->package_file' && ret=0
+      ;;
+    package-select)
+      case "${opt_args[(i)${sopts// /|}]}" in
+	-f|--file) _files ;;
+	-p|--package) state=package_file ;;
+	-g|--group) state=groups ;;
+	--fileid|--pkgid) _message -e md5 md5 ;;
+	--hdrid) _message -e sha1 sha1 ;;
+	--querybynumber) _message -e value number ;;
+	--what*) state=capabilities ;;
+	--specfile) state=spec_files ;;
+	*) state=package ;;
+     esac
+    ;;
+    macros)
+      local -a macros
+      local mfile
+      for mfile in {/usr/lib/rpm/{,redhat/}macros,/etc/rpm/macros,~/.rpmmacros}(N); do
+        macros+=( ${${(M)${(f)"$(<$mfile)"}:#%[^\{]*}%%[[:blank:]]*} )
+      done
+      if zstyle -t ":completion:${curcontext}:macros" prefix-hidden; then
+	macros=( ${macros#%} )
+	_wanted macros expl macro compadd -p '%' -a - macros
+      else
+	_wanted macros expl macro compadd -a - macros
+      fi
+      ;;
+    command)
+      compset -q
+      _normal
       ;;
     target)
-      _wanted target expl 'Target platforms' \
-          compadd $(_call_program target rpm --showrc 2> /dev/null |grep 'compatible archs'|sed 's/.*: //') && ret=0
+      _wanted targets expl 'target platform' compadd \
+	  ${${(M)${(f)"$(_call_programs targets rpm --showrc)"}:#compatible archs*}##*: } && ret=0
       ;;
+    groups)
+      if ( (( ! $+_rpm_groups )) || _cache_invalid rpm-groups ) &&
+	  ! _retrieve_cache rpm-groups
+      then
+	typeset -gaU _rpm_groups
+	_rpm_groups=(
+	    ${(f)"$(_call_program groups rpm -qa --queryformat '%\{group}\\n' 2>/dev/null)"}
+	)
+	_store_cache RPM-groups _rpm_groups
+      fi
+      _wanted groups expl 'group' _multi_parts / _rpm_groups && ret=0
+    ;;
     package_or_file)
       state=package_file
-      ;&
+      ;;
     package)
       if ( [[ ${+_rpms} -eq 0 ]] || _cache_invalid RPMs ) &&
-         ! _retrieve_cache RPMs;
+	 ! _retrieve_cache RPMs;
       then
-        _rpms=( $(_call_program packages rpm -qa 2>/dev/null) )
-        _store_cache RPMs _rpms
+	_rpms=( $(_call_program packages rpm -qa 2>/dev/null) )
+	_store_cache RPMs _rpms
       fi
-      _wanted packages expl 'RPM package' \
-          compadd -M 'r:|-=* r:|=*' - "$_rpms[@]" && ret=0
+      _wanted packages expl 'package' \
+	  compadd -M 'r:|-=* r:|=*' - "$_rpms[@]" && ret=0
       ;;
-    spec_file)
+    spec_files)
       _wanted specfiles expl 'spec file' \
-          _files -g \*.spec && ret=0
+	  _files -g \*.spec && ret=0
       ;;
     package_file)
-      _wanted files expl 'RPM package file' \
-          _files -g '*.(#i)rpm' && ret=0
+      _wanted files expl 'package file' \
+	  _files -g '*.(#i)rpm' && ret=0
       if [[ -prefix 1 (f|ht)tp:// ]]; then
-        _wanted urls expl 'URL of RPM package file' \
-            _urls -f -g '*.(#i)rpm' "${expl[@]}" && ret=0
+	_wanted urls expl 'URL of rpm package file' \
+	    _urls -f -g '*.(#i)rpm' "${expl[@]}" && ret=0
       else
-        _wanted urls expl 'URL of RPM package file' \
-            compadd -S '' "${expl[@]}" ftp:// http:// && ret=0
+	_wanted urls expl 'URL of rpm package file' \
+	    compadd -S '' "${expl[@]}" ftp:// http:// && ret=0
       fi
       ;;
     package_src)
-      _files -g \*.src\(\#i\).rpm
-     ;&
+      _files -g "(#i)*.src.rpm" && ret=0
+      ;;
     tags)
-      if compset -P '*%*\{'; then
-        _wanted tags expl 'RPM tag' \
-            compadd -M 'm:{a-z}={A-Z}' -S '\}' - \
-                    "${(@)${(@f)$(_call_program tags rpm --querytags 2> /dev/null)}#RPMTAG_}" && ret=0
+      local -a suf
+      if compset -P "*%*${${QIPREFIX:+{}:-\{}"; then
+        compset -S '(|\\)}*' || suf=( -qS ${${QIPREFIX:+\}}:-\\\}} )
+	_wanted tags expl 'rpm tag' compadd -M 'm:{a-z}={A-Z}' "$suf[@]" - \
+	    "${(L@)${(@f)$(_call_program tags rpm --querytags 2>/dev/null)}#RPMTAG_}" && ret=0
       else
-        _message -e formats 'RPM format'
+	_message -e formats 'rpm query format'
       fi
       ;;
-    capability)
-      _message -e capabilities 'RPM capability'
+    capabilities)
+      _wanted capabilities expl capability compadd \
+	  ${(f)"$(_call_program capabilities rpm -qa --queryformat '%\{requirename}\\n' 2>/dev/null)"}
       ;;
     relocate)
       if compset -P '*='; then
-        _description directories expl 'new path'
+	_description directories expl 'new path'
       else
-        _description directories expl 'old path'
+	_description directories expl 'old path'
       fi
-  
+
       _files "$expl[@]" -/ && ret=0
       ;;
     esac
-  
+
     [[ ret -eq 0 || $nm -ne $compstate[nmatches] ]] && return 0
   done
-  
+
   return ret
 }
 
diff --git a/Completion/Unix/Command/_apm b/Completion/Unix/Command/_apm
index 7fb035e8e..efe50d713 100644
--- a/Completion/Unix/Command/_apm
+++ b/Completion/Unix/Command/_apm
@@ -1,51 +1,41 @@
 #compdef apm
 
-if [[ $OSTYPE == linux* ]]
-then
+if [[ $OSTYPE == linux* ]]; then
 
-_arguments -C -s \
-    '(--version)-V[print the apm program and exit immediately]' \
-    '(-V)--version[print the apm program and exit immediately]' \
-    '(--verbose)-v[print information about APM BIOS and Linux APM driver version]' \
-    '(-v)--verbose[print information about APM BIOS and Linux APM driver version]' \
-    '(--minutes)-m[print total minutes remaining instead of using an hh:mm format]' \
-    '(-m)--minutes[print total minutes remaining instead of using an hh:mm format]' \
-    '(--suspend)-s[put the machine into suspend mode if possible]' \
-    '(-s)--suspend[put the machine into suspend mode if possible]' \
-    '(--standby)-S[put the machine into standby mode if possible]' \
-    '(-S)--standby[put the machine into standby mode if possible]' \
-    '(--noignore)-n[tell the system not to ignore system-generated APM message]' \
-    '(-n)--noignore[tell the system not to ignore system-generated APM message]' \
-    '(--ignore)-i[tell the system to ignore system-generated APM message]' \
-    '(-i)--ignore[tell the system to ignore system-generated APM message]'
+  _arguments -s \
+    '(-)'{-V,--version}'[print the apm program version and exit immediately]' \
+    '(-v --verbose)'{-v,--verbose}'[print information about APM BIOS and Linux APM driver version]' \
+    '(-m --minutes)'{-m,--minutes}'[print total minutes remaining instead of using an hh:mm format]' \
+    '(-s --suspend)'{-s,--suspend}'[put the machine into suspend mode if possible]' \
+    '(-S --standby)'{-S,--standby}'[put the machine into standby mode if possible]' \
+    '(-n --noignore)'{-n,--noignore}'[tell the system not to ignore system-generated APM message]' \
+    '(-i --ignore)'{-i,--ignore}'[tell the system to ignore system-generated APM message]' && return
 
-elif [[ $OSTYPE == freebsd* ]]
-then
+elif [[ $OSTYPE == freebsd* ]]; then
 
-_arguments -C \
-     '-a[display AC line status]' \
-     '-b[display battery status]' \
-     '-d[disable/enable display suspension]:bool:' \
-     '-e[disable/enable apm functions]:bool:' \
-     '-h[disable/enable HLT in kernel context switch]:bool:' \
-     '-l[display remaining battery percentage]' \
-     '-r[enable resume wakeup timer]' \
-     '-s[display status of APM support]' \
-     '-t[display estimated remaining battery life in seconds]' \
-     '-Z[transition system into standby mode]' \
-     '-z[suspend the system]'
-
-elif [[ $OSTYPE == openbsd* ]]
-then
-
-_arguments -C \
-     '-z[engage suspend mode]' \
-     '-S[engage stand-by mode]' \
-     '-l[display estimated battery lifetime percentage]' \
-     '-m[display estimated battery lifetime minutes]' \
-     '-b[display battery status]' \
-     '-a[display AC line status]' \
-     '-v[verbose]' \
-     '-f[socket]:sockname:_files'
+  _arguments \
+    '-a[display AC line status]' \
+    '-b[display battery status]' \
+    '-d[disable/enable display suspension]:bool:' \
+    '-e[disable/enable apm functions]:bool:' \
+    '-h[disable/enable HLT in kernel context switch]:bool:' \
+    '-l[display remaining battery percentage]' \
+    '-r[enable resume wakeup timer]' \
+    '-s[display status of APM support]' \
+    '-t[display estimated remaining battery life in seconds]' \
+    '-Z[transition system into standby mode]' \
+    '-z[suspend the system]' && return
 
+elif [[ $OSTYPE == openbsd* ]]; then
+  _arguments \
+    '-z[engage suspend mode]' \
+    '-S[engage stand-by mode]' \
+    '-l[display estimated battery lifetime percentage]' \
+    '-m[display estimated battery lifetime minutes]' \
+    '-b[display battery status]' \
+    '-a[display AC line status]' \
+    '-v[verbose]' \
+    '-f[socket]:sockname:_files' && return
 fi
+
+return 1
diff --git a/Completion/Unix/Command/_arping b/Completion/Unix/Command/_arping
index 89bdccd92..382ce247e 100644
--- a/Completion/Unix/Command/_arping
+++ b/Completion/Unix/Command/_arping
@@ -1,20 +1,22 @@
 #compdef arping
 
 _arguments -s \
-	'-h[help]' \
-	'-q[quiet]' \
-	'-v[verbose]' \
-	'-r[raw]' \
-	'-R[Raw]' \
-	'-d[find duplicate replies]' \
-	'-B[255.255.255.255]' \
-	'-0[source 0.0.0.0]' \
-	'-b[source 255.255.255.255]' \
-	'-S[set source IP]:source IP address:_hosts' \
-	'-T[target IP]:target IP address:_hosts' \
-        '-p[promiscuous mode]' \
-	'-s[set source MAC address]:source MAC address:' \
-	'-t[set target MAC address]:target MAC address:' \
-	'-c[send this many requests]:count:' \
-	'-i[interface]:interface:' \
-	':address:_hosts' \
+  '(-)-h[display help information]' \
+  '-q[only display error messages]' \
+  '-a[audible ping]' \
+  '*-v[verbose output]' \
+  '-r[raw output: only the MAC/IP address displayed]' \
+  '-R[like -r but shows "the other one"]' \
+  '-d[find duplicate replies]' \
+  '(:)-B[255.255.255.255]' \
+  '-0[source 0.0.0.0]' \
+  '-b[source 255.255.255.255]' \
+  '-S[set source IP]:source IP address:_hosts' \
+  '-T[target IP]:target IP address:_hosts' \
+  '-p[turn on promiscuous mode]' \
+  '-s[set source MAC address]:source MAC address' \
+  '-t[set target MAC address]:target MAC address' \
+  '-c[send this many requests]:count' \
+  '-i[interface]:interface' \
+  '-A[only count addresses matching requested address]' \
+  '(-B):address:_hosts' \
diff --git a/Completion/Unix/Command/_cvs b/Completion/Unix/Command/_cvs
index 9ad057b68..b687f9874 100644
--- a/Completion/Unix/Command/_cvs
+++ b/Completion/Unix/Command/_cvs
@@ -2,7 +2,7 @@
 
 # redefine _cvs.
 
-_cvs () {
+_cvs() {
   local extra
 
   # "+Qqrwtnlvb:T:e:d:Hfz:s:xa"
@@ -24,60 +24,58 @@ _cvs () {
     '-t[trace]' \
     '(-r)-w[make new working file read-write]' \
     '-x[encrypt client/server communication]' \
-    '(--version)-v[print version]' \
-    '(-v)--version[print version]' \
-    '(   --help --help-commands --help-synonyms --help-options)-H[print help]' \
-    '(-H        --help-commands --help-synonyms --help-options)--help[print help]' \
-    '(-H --help                 --help-synonyms --help-options)--help-commands[command help]' \
-    '(-H --help --help-commands                 --help-options)--help-synonyms[command synonyms help]' \
-    '(-H --help --help-commands --help-synonyms               )--help-options[global options help]' \
+    '(-)'{-v,--version}'[print version and copyright information]' \
+    '(-)'{-H,--help}'[print help information]' \
+    '(-)--help-commands[command help]' \
+    '(-)--help-synonyms[command synonyms help]' \
+    '(-)--help-options[global options help]' \
     '*--allow-root=[allowable root for pserver]:rootdir:_files -/' \
-    '-b+[binary directory]:bindir:_cvs_bindir' \
     '-T+[temporary directory]:temporary directory:_cvs_tempdir' \
     '-d+[cvs root directory]:cvsroot:_cvs_root' \
     '-e+[editor]:editor:_cvs_editor' \
     '-s+[user variable]:user variable:_cvs_user_variable' \
-    '-z+[gzip level]:gzip level:_cvs_gzip_level' \
+    '-z+[gzip level]:gzip level:(0 1 2 3 4 5 6 7 8 9)' \
     '*::cvs command:_cvs_command'
 }
 
 # define cvs command dispatch function.
 
 (( $+functions[_cvs_command] )) ||
-_cvs_command () {
-  local cmd cvsroot="$CVSROOT"
+_cvs_command() {
+  local cmd cvsroot="$CVSROOT" ret=1
   [[ -f CVS/Root ]] && cvsroot="$(<CVS/Root)"
   [[ -n "$opt_args[-d]" ]] && cvsroot=${(e)~opt_args[-d]:Q}
 
-  if (( ! $+_cvs_cmds )); then
-    typeset -gA _cvs_cmds
-    _cvs_cmds=(
-      ${(f)${(F)${${(M)${(f)"$(_call_program commands cvs --help-commands 2>&1)"}:# *}/(#b) #([a-z]##) */$match[1]
- }}}
-      ${(f)${(F)${${(M)${(f)"$(_call_program synonyms cvs --help-synonyms 2>&1)"}:# *}/(#b) #([a-z]#)   #([a-z]#) ([a-z]#)/$match[1]
- $match[2] $match[3] }}}
-    )
+  if (( ! $+_cvs_syns )); then
+    typeset -gA _cvs_syns
+    _cvs_syns=( ${(s. .)${(f)"$(cvs --help-synonyms 2>&1)"}[2,-2]/(#b) #([a-z]#)   #([a-z]#) ([a-z]#)/$match[1] $match[2]:$match[3]} )
   fi
 
+  (( $+_cvs_cmds )) || _cvs_cmds=(
+    ${${(f)"$(_call_program commands cvs --help-commands 2>&1)"}[2,-2]/(#b) #([a-z]##) #([A-Z])/$match[1]:${match[2]:l}}
+    'version:display cvs version being used on client and server'
+  )
+
   if (( CURRENT == 1 )); then
-    _tags commands && { compadd "$@" -k _cvs_cmds || compadd "$@" ${(kv)=_cvs_cmds} }
+    _describe -t commands 'cvs command' _cvs_cmds || compadd "$@" - ${(s.:.)${(j.:.)_cvs_syns}}
   else
     local curcontext="$curcontext"
 
-    cmd="${${(k)_cvs_cmds[(R)* $words[1] *]}:-${(k)_cvs_cmds[(i)$words[1]]}}"
+    cmd="${${_cvs_cmds[(r)$words[1]:*]%%:*}:-${(k)_cvs_syns[(r)(*:|)$words[1](:*|)]}}"
     if (( $#cmd )); then
       curcontext="${curcontext%:*:*}:cvs-${cmd}:"
-      _cvs_$cmd
+      _call_function ret _cvs_$cmd || _message 'no more arguments'
     else
       _message "unknown cvs command: $words[1]"
     fi
+    return ret
   fi
 }
 
 # define completion functions for each cvs command
 
 (( $+functions[_cvs_add] )) ||
-_cvs_add () {
+_cvs_add() {
   # "+k:m:"
   _arguments -s \
     '-k+[keyword]:keyword substitution:_cvs_k' \
@@ -86,7 +84,7 @@ _cvs_add () {
 }
 
 (( $+functions[_cvs_admin] )) ||
-_cvs_admin () {
+_cvs_admin() {
   # "+ib::c:a:A:e::l::u::LUn:N:m:o:s:t::IqxV:k:"
   _arguments -s \
     -{i,x} \
@@ -95,25 +93,25 @@ _cvs_admin () {
     '-I[interactive]' \
     '-q[quiet]' \
     '-b-[default branch]:default branch:(1.1.1)' \
-    '-c+:comment leader (not used):' \
-    '-a+:login names (not work with CVS):' \
-    '-A+:access list to append (not work with CVS):' \
-    '-e-:access list to erase (not work with CVS):' \
-    '-l-[lock]:revision to lock:' \
-    '-u-[unlock]:revision to unlock:' \
-    '-n+[name revision]:symbolic-name(\:revision):' \
-    '-N+[force to name revision]:symbolic-name(\:revision):' \
-    '-m+[replace log]:revision\:msg:' \
-    '-o+[delete revision]:range to delete:' \
-    '-s+[replace state attribute]:state(\:revision):' \
+    '-c+:comment leader (not used)' \
+    '-a+:login names (not work with CVS)' \
+    '-A+:access list to append (not work with CVS)' \
+    '-e-:access list to erase (not work with CVS)' \
+    '-l-[lock]:revision to lock' \
+    '-u-[unlock]:revision to unlock' \
+    '-n+[name revision]:symbolic-name(\:revision)' \
+    '-N+[force to name revision]:symbolic-name(\:revision)' \
+    '-m+[replace log]:revision\:msg' \
+    '-o+[delete revision]:range to delete' \
+    '-s+[replace state attribute]:state(\:revision)' \
     '-t-[replace descriptive text]:descriptive text:_cvs_admin_t' \
-    '-V+:version (obsolete):' \
+    '-V+:version (obsolete)' \
     '-k+[set keyword substitution]:keyword substitution:_cvs_k' \
     '*:file:_cvs_files'
 }
 
 (( $+functions[_cvs_admin_t] )) ||
-_cvs_admin_t () {
+_cvs_admin_t() {
   if compset -P -; then
     _message -e descriptions 'descriptive text'
   else
@@ -122,7 +120,7 @@ _cvs_admin_t () {
 }
 
 (( $+functions[_cvs_annotate] )) ||
-_cvs_annotate () {
+_cvs_annotate() {
   # "+lr:D:fR"
   _arguments -s \
     "(-R)-l[don't recurse]" \
@@ -134,7 +132,7 @@ _cvs_annotate () {
 }
 
 (( $+functions[_cvs_rannotate] )) ||
-_cvs_rannotate () {
+_cvs_rannotate() {
   # "+lr:D:fR"
   _arguments -s \
     "(-R)-l[don't recurse]" \
@@ -146,7 +144,7 @@ _cvs_rannotate () {
 }
 
 (( $+functions[_cvs_checkout] )) ||
-_cvs_checkout () {
+_cvs_checkout() {
   # "+ANnk:d:flRpQqcsr:D:j:P"
   _arguments -s \
     '-N[don'\''t shorten module paths]' \
@@ -167,7 +165,7 @@ _cvs_checkout () {
 }
 
 (( $+functions[_cvs_commit] )) ||
-_cvs_commit () {
+_cvs_commit() {
   # "+nlRm:fF:r:"
   _arguments -s \
     '-n[disable module program]' \
@@ -181,7 +179,7 @@ _cvs_commit () {
 }
 
 (( $+functions[_cvs_diff] )) ||
-_cvs_diff () {
+_cvs_diff() {
   local of ofwuc ouc oss ofwy ofwg ofwl
   # output formats
   of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \
@@ -220,83 +218,59 @@ _cvs_diff () {
     "(-R)-l[don't recurse]" \
     '(-l)-R[recursive]' \
     '-k+[keyword]:keyword substitution:_cvs_k' \
-    '(-r)-D+[specify date]:date:_cvs_D' \
-    '(-r)-D+[specify date]:date:_cvs_D' \
-    '(-D)-r+[specify revision]:tag:_cvs_revisions' \
-    '(-D)-r+[specify revision]:tag:_cvs_revisions' \
+    {,}'(-r)-D+[specify date]:date:_cvs_D' \
+    {,}'(-D)-r+[specify revision]:tag:_cvs_revisions' \
     -{h,0,1,2,3,4,5,6,7,8,9} \
     '--binary[binary mode]' \
-    '--ifdef=[set macro name for merged if-then-else format]:name:' \
-    '(-i)--ignore-case[case insensitive]' \
-    '(--ignore-case)-i[case insensitive]' \
-    '(-w)--ignore-all-space[ignore all white space]' \
-    '(--ignore-all-space)-w[ignore all white space]' \
-    '(-b)--ignore-space-change[ignore changes in the amount of white space]' \
-    '(--ignore-space-change)-b[ignore changes in the amount of white space]' \
-    '(-B)--ignore-blank-lines[ignore lines that are all blank]' \
-    '(--ignore-blank-lines)-B[ignore lines that are all blank]' \
-    '(-I)--ignore-matching-lines=[ignore lines that match regex]:line exclusion regex:' \
-    '(--ignore-matching-lines)-I+[ignore lines that match regex]:line exclusion regex:' \
-    '(-a)--text[treat all files as text]' \
-    '(--text)-a[treat all files as text]' \
-    "($of $oss)--context=-[context diff]:number of lines of copied context:" \
-    "($of $oss)-C+[output a context diff]:number of lines of copied context:" \
+    '--ifdef=[set macro name for merged if-then-else format]:name' \
+    '(-i --ignore-case)'{-i,--ignore-case}'[case insensitive]' \
+    '(-w --ignore-all-space)'{-w,--ignore-all-space}'[ignore all white space]' \
+    '(-b --ignore-space-change)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \
+    '(-B --ignore-blank-lines)'{-B,--ignore-blank-lines}'[ignore lines that are all blank]' \
+    '(-I --ignore-matching-lines)'{-I+,--ignore-matching-lines=}'[ignore lines that match regex]:line exclusion regex' \
+    '(-a --text)'{-a,--text}'[treat all files as text]' \
+    "($of $oss)"{-C+,--context=-}'[context diff; specify lines of context]:number of lines of context' \
     "($of $oss)-c[output a context diff]" \
-    "($of $oss)--unified=-[output a unified diff]:number of lines of unified context:" \
-    "($of $oss)-U+[output a unified diff]:number of lines of unified context:" \
+    "($of $oss)"{-U+,--unified=-}'[unified diff; specify lines of context]:number of lines of context' \
     "($of $oss)-u[output a unified diff]" \
-    "($ofwuc $oss -L)--label=[set label to use instead of file name]:label:" \
-    "($ofwuc $oss --label)-L+[set label to use instead of file name]:label:" \
-    "($ofwuc $oss -L)--label=[set label to use instead of file name]:label:" \
-    "($ofwuc $oss --label)-L+[set label to use instead of file name]:label:" \
-    "($ofwuc $oss -p)--show-c-function[show C function of each change]" \
-    "($ofwuc $oss --show-c-function)-p[show C function of each change]" \
-    "($ofwuc $oss -F)--show-function-line=[show the most recent line matching regex]:regex:" \
-    "($ofwuc $oss --show-function-line)-F+[show the most recent line matching regex]:regex:" \
+    {,}"($ofwuc $oss -L --label)"{-L+,--label=}'[set label to use instead of file name]:label' \
+    "($ofwuc $oss -p --show-c-function)"{-p,--show-c-function}'[show C function of each change]' \
+    "($ofwuc $oss -F --show-function-line=)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' \
     "($of $ouc $oss)--brief[output only whether files differ]" \
-    "($of $ouc $oss)--ed[output an ed script]" \
-    "($of $ouc $oss)-e[output an ed script]" \
-    "($of $ouc $oss)--forward-ed[output a reversed ed script]" \
-    "($of $ouc $oss)-f[output a reversed ed script]" \
-    "($of $ouc $oss)--rcs[RCS format diff]" \
-    "($of $ouc $oss)-n[RCS format diff]" \
+    "($of $ouc $oss)"{-e,--ed}'[output an ed script]' \
+    "($of $ouc $oss)"{-f,--forward-ed}'[output a reversed ed script]" \
+    "($of $ouc $oss)"{-n,--rcs}'[RCS format diff]" \
     "($of $ouc)--side-by-side[output in two columns]" \
     "($of $ouc)-y[output in two columns]" \
-    "($ofwy $ouc -W)--width=[set size of line]:number of characters per line:" \
-    "($ofwy $ouc --width)-W+[set size of line]:number of characters per line:" \
+    "($ofwy $ouc -W --width)"{-W+,--width=}'[set size of line]:number of characters per line' \
     "($ofwy $ouc)--left-column[output only left column of common lines]" \
     "($ofwy $ouc)--suppress-common-lines[do not output common lines]" \
-    "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format:" \
-    "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format:" \
-    "($ofwg $ouc $oss)--changed-group-format=[set changed group format]:changed group format:" \
-    "($ofwg $ouc $oss)--unchanged-group-format=[set unchanged group format]:unchanged group format:" \
-    "($ofwl $ouc $oss)--line-format=[set line format]:line format:" \
-    "($ofwl $ouc $oss)--old-line-format=[set old line format]:old line format:" \
-    "($ofwl $ouc $oss)--new-line-format=[set new line format]:new line format:" \
-    "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format:" \
+    "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format" \
+    "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format" \
+    "($ofwg $ouc $oss)--changed-group-format=[set changed group format]:changed group format" \
+    "($ofwg $ouc $oss)--unchanged-group-format=[set unchanged group format]:unchanged group format" \
+    "($ofwl $ouc $oss)--line-format=[set line format]:line format" \
+    "($ofwl $ouc $oss)--old-line-format=[set old line format]:old line format" \
+    "($ofwl $ouc $oss)--new-line-format=[set new line format]:new line format" \
+    "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format" \
     '--paginate[output through pr]' \
-    '(-t)--expand-tabs[expand tabs to spaces]' \
-    '(--expand-tabs)-t[expand tabs to spaces]' \
+    '(-t --expand-tabs)'{-t,--expand-tabs}'[expand tabs to spaces]' \
     '--initial-tab[prepend a tab]' \
-    '(-N)--new-file[treat absent files as empty]' \
-    '(--new-file)-N[treat absent files as empty]' \
-    '(-s)--report-identical-files[report when two files are the same]' \
-    '(--report-identical-files)-s[report when two files are the same]' \
-    '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines:' \
-    '(-d)--minimal[try to find a smaller set of changes]' \
-    '(--minimal)-d[try to find a smaller set of changes]' \
-    '(-H)--speed-large-files[assume large files and many small changes]' \
-    '(--speed-large-files)-H[assume large files and many small changes]' \
+    '(-N --new-file)'{-N,--new-file}'[treat absent files as empty]' \
+    '(-s --report-identical-files)'{-s,--report-identical-files}'[report when two files are the same]' \
+    '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines' \
+    '(-d --minimal)'{-d,--minimal}'[try to find a smaller set of changes]' \
+    '(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' \
     '*:file:_cvs_diff_arg'
 }
 
 (( $+functions[_cvs_diff_arg] )) ||
-_cvs_diff_arg () {
+_cvs_diff_arg() {
   _cvs_files_modified || _cvs_files
 }
 
 (( $+functions[_cvs_edit] )) ||
-_cvs_edit () {
+_cvs_edit() {
   # "+lRa:"
   _arguments -s \
     "(-R)-l[don't recurse]" \
@@ -306,7 +280,7 @@ _cvs_edit () {
 }
 
 (( $+functions[_cvs_editors] )) ||
-_cvs_editors () {
+_cvs_editors() {
   # "+lR"
   _arguments -s \
     "(-R)-l[don't recurse]" \
@@ -315,7 +289,7 @@ _cvs_editors () {
 }
 
 (( $+functions[_cvs_export] )) ||
-_cvs_export () {
+_cvs_export() {
   # "+Nnk:d:flRQqr:D:"
   _arguments -s \
     '-N[don'\''t shorten module paths]' \
@@ -331,7 +305,7 @@ _cvs_export () {
 }
 
 (( $+functions[_cvs_history] )) ||
-_cvs_history () {
+_cvs_history() {
   # "+Tacelow?D:b:f:m:n:p:r:t:u:x:X:z:"
   _arguments -s \
     '-T[all tags]' \
@@ -342,22 +316,22 @@ _cvs_history () {
     '-o[check-outed modules]' \
     '-w[working directory]' \
     '-D+[since date]:date:_cvs_D' \
-    '-b+[back to record]:string:' \
+    '-b+[back to record]:string' \
     '-f+[specify file]:file:_cvs_files' \
     '-m+[specify module]:module:_cvs_modules' \
     '*-n+[in module]:module:_cvs_modules' \
-    '*-p+[in repository]:repository:' \
-    '-r+[since revision]:rev:' \
-    '-t+[since tag]:tag:' \
-    '*-u+[specify user]:user name:' \
+    '*-p+[in repository]:repository' \
+    '-r+[since revision]:rev' \
+    '-t+[since tag]:tag' \
+    '*-u+[specify user]:user name' \
     '-x+[specify type]:type:_cvs_history_x' \
-    '-X+[debugging]:arg:' \
-    '-z+[specify timezone]:timezone:' \
+    '-X+[debugging]:arg' \
+    '-z+[specify timezone]:timezone' \
     '*:file:_cvs_files'
 }
 
 (( $+functions[_cvs_history_x] )) ||
-_cvs_history_x () {
+_cvs_history_x() {
   _values -s '' 'type' \
     'F[release]' \
     'O[checkout]' \
@@ -373,7 +347,7 @@ _cvs_history_x () {
 }
 
 (( $+functions[_cvs_import] )) ||
-_cvs_import () {
+_cvs_import() {
   # "+Qqdb:m:I:k:W:"
   _arguments -s \
     '-d[use file modification time]' \
@@ -384,16 +358,11 @@ _cvs_import () {
     '*-W+[wrapper specification]:spec:_files' \
     ':repository:_cvs_modules' \
     ':vendor tag:_cvs_vendor_branches' \
-    ':release tag:'
-}
-
-(( $+functions[_cvs_init] )) ||
-_cvs_init () {
-  false
+    ':release tag'
 }
 
 (( $+functions[_cvs_log] )) ||
-_cvs_log () {
+_cvs_log() {
   # "+bd:hlNRr::s:tw::"
   _arguments -s \
     '-b[default branch]' \
@@ -402,15 +371,15 @@ _cvs_log () {
     '-R[print the name of RCS file in the repository]' \
     '-N[don'\''t list tags]' \
     '(-h)-t[header with descriptive text]' \
-    '-d+[specify dates]:dates:' \
-    '-r-[specify revisions]:revisions:' \
+    '-d+[specify dates]:dates' \
+    '-r-[specify revisions]:revisions' \
     '-s+[specify states]:states:(Exp Stab Rel dead)' \
-    '-w-[specify logins]:logins:' \
+    '-w-[specify logins]:logins' \
     '*:file:_cvs_files'
 }
 
 (( $+functions[_cvs_rlog] )) ||
-_cvs_rlog () {
+_cvs_rlog() {
   # "+bd:hlNRr::s:tw::"
   _arguments -s \
     '-b[default branch]' \
@@ -419,25 +388,15 @@ _cvs_rlog () {
     '(-l)-R[recursive]' \
     '-N[don'\''t list tags]' \
     '(-h)-t[header with descriptive text]' \
-    '-d+[specify dates]:dates:' \
-    '-r-[specify revisions]:revisions:' \
+    '-d+[specify dates]:dates' \
+    '-r-[specify revisions]:revisions' \
     '-s+[specify states]:states:(Exp Stab Rel dead)' \
-    '-w-[specify logins]:logins:' \
+    '-w-[specify logins]:logins' \
     '*:file:_cvs_modules'
 }
 
-(( $+functions[_cvs_login] )) ||
-_cvs_login () {
-  false
-}
-
-(( $+functions[_cvs_logout] )) ||
-_cvs_logout () {
-  false
-}
-
 (( $+functions[_cvs_rdiff] )) ||
-_cvs_rdiff () {
+_cvs_rdiff() {
   # "+V:k:cuftsQqlRD:r:"
   _arguments -s \
     '-c[output a context diff]' \
@@ -446,7 +405,7 @@ _cvs_rdiff () {
     '-s[short patch]' \
     "(-R)-l[don't recurse]" \
     '(-l)-R[recursive]' \
-    '-V+[specify version]:version:' \
+    '-V+[specify version]:version' \
     '-k+[keyword]:keyword substitution:_cvs_k' \
     '(-D -D -r -r)-t[top two differences]' \
     '(-t -r)-D+[specify date]:date:_cvs_D' \
@@ -457,7 +416,7 @@ _cvs_rdiff () {
 }
 
 (( $+functions[_cvs_release] )) ||
-_cvs_release () {
+_cvs_release() {
   # "+Qdq"
   _arguments -s \
     '-d[delete]' \
@@ -465,7 +424,7 @@ _cvs_release () {
 }
 
 (( $+functions[_cvs_remove] )) ||
-_cvs_remove () {
+_cvs_remove() {
   # "+flR"
   _arguments -s \
     '-f[force to remove]' \
@@ -475,7 +434,7 @@ _cvs_remove () {
 }
 
 (( $+functions[_cvs_remove_arg] )) ||
-_cvs_remove_arg () {
+_cvs_remove_arg() {
   if (( $+opt_args[-f] )); then
     _cvs_files
   else
@@ -484,7 +443,7 @@ _cvs_remove_arg () {
 }
 
 (( $+functions[_cvs_rtag] )) ||
-_cvs_rtag () {
+_cvs_rtag() {
   # "+FanfQqlRdbr:D:"
   _arguments -s \
     '(-d)-F[move tag if already exists]' \
@@ -497,12 +456,12 @@ _cvs_rtag () {
     '(-d)-b[create branch]' \
     '-D+[specify date]:date:_cvs_D' \
     '-r+[specify revision]:tag:_cvs_revisions' \
-    ':tag:' \
+    ':tag' \
     '*:module:_cvs_modules'
 }
 
 (( $+functions[_cvs_status] )) ||
-_cvs_status () {
+_cvs_status() {
   # "+vlR"
   _arguments -s \
     '-v[verbose]' \
@@ -512,7 +471,7 @@ _cvs_status () {
 }
 
 (( $+functions[_cvs_tag] )) ||
-_cvs_tag () {
+_cvs_tag() {
   # "+FQqlRcdr:D:bf"
   _arguments -s \
     '(-d)-F[move tag if already exists]' \
@@ -529,7 +488,7 @@ _cvs_tag () {
 }
 
 (( $+functions[_cvs_unedit] )) ||
-_cvs_unedit () {
+_cvs_unedit() {
   # "+lR"
   _arguments -s \
     "(-R)-l[don't recurse]" \
@@ -538,7 +497,7 @@ _cvs_unedit () {
 }
 
 (( $+functions[_cvs_update] )) ||
-_cvs_update () {
+_cvs_update() {
   # "+ApCPflRQqduk:r:D:j:I:W:"
   _arguments -s \
     '-C[overwrite local modification]' \
@@ -559,7 +518,7 @@ _cvs_update () {
 }
 
 (( $+functions[_cvs_watch] )) ||
-_cvs_watch () {
+_cvs_watch() {
   local expl
 
   if (( CURRENT == 2 )); then
@@ -568,39 +527,34 @@ _cvs_watch () {
     case "$words[2]" in
       on|off) # "+lR"
 	_arguments -s \
-	    "(-R)-l[don't recurse]" \
-	    '(-l)-R[recursive]' \
-	    ':watch command:' \
-	    '*:file:_cvs_files'
-	;;
+	  "(-R)-l[don't recurse]" \
+	  '(-l)-R[recursive]' \
+	  ':watch command' \
+	  '*:file:_cvs_files'
+      ;;
       add|remove) # "+lRa:"
 	_arguments -s \
-	    "(-R)-l[don't recurse]" \
-	    '(-l)-R[recursive]' \
-	    '*-a+[specify action]:action:(edit unedit commit all none)' \
-	    ':watch command:' \
-	    '*:file:_cvs_files'
-	;;
+	  "(-R)-l[don't recurse]" \
+	  '(-l)-R[recursive]' \
+	  '*-a+[specify action]:action:(edit unedit commit all none)' \
+	  ':watch command' \
+	  '*:file:_cvs_files'
+      ;;
     esac
   fi
 }
 
 (( $+functions[_cvs_watchers] )) ||
-_cvs_watchers () {
+_cvs_watchers() {
   # "+lR"
   _arguments -s \
-      "(-R)-l[don't recurse]" \
-      '(-l)-R[recursive]' \
-      '*:file:_cvs_files'
-}
-
-(( $+functions[_cvs_version] )) ||
-_cvs_version () {
-  false
+    "(-R)-l[don't recurse]" \
+    '(-l)-R[recursive]' \
+    '*:file:_cvs_files'
 }
 
 (( $+functions[_cvs_loadstat] )) ||
-_cvs_loadstat () {
+_cvs_loadstat() {
   zstyle -t ":completion:${curcontext}:" disable-stat && return 1
   (( $+_cvs_loadstat_status )) && return $_cvs_loadstat_status
 
@@ -610,7 +564,7 @@ _cvs_loadstat () {
 }
 
 (( $+functions[_cvs_root] )) ||
-_cvs_root () {
+_cvs_root() {
   local cvspassfile id slash
 
   typeset -gU _cvs_roots
@@ -636,12 +590,12 @@ _cvs_root () {
 }
 
 (( $+functions[_cvs_tempdir] )) ||
-_cvs_tempdir () {
+_cvs_tempdir() {
   _tags directories && compadd "$@" $TMPPREFIX:h $TMPDIR /tmp
 }
 
 (( $+functions[_cvs_user_variable] )) ||
-_cvs_user_variable () {
+_cvs_user_variable() {
   if compset -P '*='; then
     _default
   else
@@ -651,30 +605,20 @@ _cvs_user_variable () {
 
 # define completion functions for cvs global options.
 
-(( $+functions[_cvs_bindir] )) ||
-_cvs_bindir () {
-  _tags directories && { compadd "$@" /usr/local/bin || _files "$@" -/ }
-}
-
 (( $+functions[_cvs_editor] )) ||
-_cvs_editor () {
+_cvs_editor() {
   _tags commands && compadd "$@" vi
 }
 
-(( $+functions[_cvs_gzip_level] )) ||
-_cvs_gzip_level () {
-  _tags values && compadd "$@" 9
-}
-
 # define completion functions for cvs common options and arguments.
 
 (( $+functions[_cvs_D] )) ||
-_cvs_D () {
+_cvs_D() {
   _tags values && compadd "$@" today yesterday week\ ago month\ ago
 }
 
 (( $+functions[_cvs_k] )) ||
-_cvs_k () {
+_cvs_k() {
   _values 'keyword substitution' \
     'kv[generate keyword strings using the default form]' \
     "kvl[include locker's name in strings if given revision is locked]" \
@@ -685,12 +629,12 @@ _cvs_k () {
 }
 
 (( $+functions[_cvs_m] )) ||
-_cvs_m () {
+_cvs_m() {
   _message -e messages "log message"
 }
 
 (( $+functions[_cvs_modules] )) ||
-_cvs_modules () {
+_cvs_modules() {
   if compset -P '(#m)(*/)'; then
     _cvs_sub_modules "$cvsroot" "${MATCH%/}"
   else
@@ -699,13 +643,13 @@ _cvs_modules () {
 }
 
 (( $+functions[_cvs_top_modules] )) ||
-_cvs_top_modules () {
+_cvs_top_modules() {
   local root="$1"
 
   if [[ -d $root ]]; then
     _wanted modules expl 'module name' \
-        compadd - $root/*(/:t) \
-            ${${(M)${(f)"$(<$root/CVSROOT/modules)"}:#[^#]*}%%[ 	]*}
+	compadd - $root/*(/:t) \
+	    ${${(M)${(f)"$(<$root/CVSROOT/modules)"}:#[^#]*}%%[ 	]*}
   else
     if [[ "$_cvs_top_modules_cache_key" != "$root" ]]; then
       _cvs_top_modules_cache_key="$root"
@@ -722,7 +666,7 @@ _cvs_top_modules () {
     fi
     if (( $#_cvs_top_modules_cache_mods )); then
       _wanted modules expl 'module name' \
-        compadd -a _cvs_top_modules_cache_mods
+	compadd -a _cvs_top_modules_cache_mods
     else
       _message -e modules 'module name'
     fi
@@ -730,7 +674,7 @@ _cvs_top_modules () {
 }
 
 (( $+functions[_cvs_sub_modules] )) ||
-_cvs_sub_modules () {
+_cvs_sub_modules() {
   local root="$1" dir="$2" ignore
 
   if [[ -d $root ]]; then
@@ -746,7 +690,7 @@ _cvs_sub_modules () {
     fi
     if (( $#_cvs_sub_modules_cache_mods )); then
       _wanted modules expl 'module name' \
-        compadd -qS/ -a _cvs_sub_modules_cache_mods
+	compadd -qS/ -a _cvs_sub_modules_cache_mods
     else
       _message -e modules 'module name'
     fi
@@ -755,7 +699,7 @@ _cvs_sub_modules () {
 
 # _cvs_run cvsroot directory cvs-arguments...
 (( $+functions[_cvs_run] )) ||
-_cvs_run () {
+_cvs_run() {
   local cvsroot="$1" dir="$2"
   shift 2
   local d=/tmp/zsh-cvs-work-$$
@@ -772,7 +716,7 @@ _cvs_run () {
 
 # _cvs_remote_directories cvsroot directory [variable]
 (( $+functions[_cvs_remote_directories] )) ||
-_cvs_remote_directories () {
+_cvs_remote_directories() {
   local root="$1" dir="$2" subdirs
   shift 2
   subdirs=(${${(M)${(f)"$(_call_program directories _cvs_run "$root" "$dir" update -r00 -d -p 2>&1)"}:#* New directory \`*\' -- ignored}/(#b)*\`(*)\'*/$match[1]})
@@ -786,7 +730,7 @@ _cvs_remote_directories () {
 }
 
 (( $+functions[_cvs_vendor_branches] )) ||
-_cvs_vendor_branches () {
+_cvs_vendor_branches() {
   local expl vendor_branch
   vendor_branch=()
   if zstyle -T ":completion:${curcontext}:" remote-access; then
@@ -806,7 +750,7 @@ _cvs_vendor_branches () {
 
 # _cvs_extract_vendor_branch [-b numeric-branch] cvsroot directory [variable]
 (( $+functions[_cvs_extract_vendor_branch] )) ||
-_cvs_extract_vendor_branch () {
+_cvs_extract_vendor_branch() {
   local numeric='1\.1\.1'
   if [[ $1 = -b ]]; then
     numeric="${2//./\\.}"
@@ -841,7 +785,7 @@ q
 }
 
 (( $+functions[_cvs_revisions] )) ||
-_cvs_revisions () {
+_cvs_revisions() {
   local expl
 
   if [[ $_cvs_revisions_key != $cvsroot:$PWD ]]; then
@@ -850,7 +794,7 @@ _cvs_revisions () {
       _cvs_revisions_cache=(
 	$(CVS_IGNORE_REMOTE_ROOT= _call_program tags cvs -d "$cvsroot" -q status -vl .|
 	  sed -n -e '/No Tags Exist/d' \
-	         -e 's/^	\([A-Za-z][-_0-9A-Za-z]*\).*/\1/p'|
+		 -e 's/^	\([A-Za-z][-_0-9A-Za-z]*\).*/\1/p'|
 	  sort|uniq)
       )
     else
@@ -868,7 +812,7 @@ _cvs_revisions () {
 # define completion functions for files maintained by cvs.
 
 (( $+functions[_cvs_files] )) ||
-_cvs_files () {
+_cvs_files() {
   _alternative \
     'directories:directory:_cvs_existing_directories' \
     'existing-files:file:_cvs_existing_entries' \
@@ -876,7 +820,7 @@ _cvs_files () {
 }
 
 (( $+functions[_cvs_files_modified] )) ||
-_cvs_files_modified () {
+_cvs_files_modified() {
   _alternative \
     'directories:directory:_cvs_existing_directories' \
     'existing-files:file:_cvs_modified_entries' \
@@ -884,28 +828,28 @@ _cvs_files_modified () {
 }
 
 (( $+functions[_cvs_files_removed] )) ||
-_cvs_files_removed () {
+_cvs_files_removed() {
   _alternative \
     'directories:directory:_cvs_existing_directories' \
     'removed-files:removed file:_cvs_nonexistent_entries'
 }
 
 (( $+functions[_cvs_files_unmaintained] )) ||
-_cvs_files_unmaintained () {
+_cvs_files_unmaintained() {
   _cvs_nonentried_files ||
   _cvs_existing_directories ||
   _cvs_strict_nonentried_files
 }
 
 (( $+functions[_cvs_existing_directories] )) ||
-_cvs_existing_directories () {
+_cvs_existing_directories() {
   local expl
   _wanted directories expl directory _path_files -g "*~(*/|)CVS(/)" ||
   _cvs_path_prefixes
 }
 
 (( $+functions[_cvs_existing_entries] )) ||
-_cvs_existing_entries () {
+_cvs_existing_entries() {
   local expl match linedir realdir pat
   match=()
   : ${PREFIX:#(#b)(*/)(*)}
@@ -917,7 +861,7 @@ _cvs_existing_entries () {
 }
 
 (( $+functions[_cvs_modified_entries] )) ||
-_cvs_modified_entries () {
+_cvs_modified_entries() {
   if _cvs_loadstat; then
     local expl match linedir realdir pat slash=/
     match=()
@@ -941,7 +885,7 @@ _cvs_ignore_default=(
 )
 
 (( $+functions[_cvs_strict_nonentried_files] )) ||
-_cvs_strict_nonentried_files () {
+_cvs_strict_nonentried_files() {
   local expl match linedir realdir omitpats
 
   match=()
@@ -953,15 +897,15 @@ _cvs_strict_nonentried_files () {
       ${${${${(M)${(f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}
     )
     if (( $#omitpats )); then
-    	_path_files -g "*~(*/|)(${(j:|:)~omitpats})(D.)"
+      _path_files -g "*~(*/|)(${(j:|:)~omitpats})(D.)"
     else
-    	_path_files -g "*~(*/|)(D.)"
+      _path_files -g "*~(*/|)(D.)"
     fi
   }
 }
 
 (( $+functions[_cvs_nonentried_files] )) ||
-_cvs_nonentried_files () {
+_cvs_nonentried_files() {
   local expl match linedir realdir omitpats
 
   match=()
@@ -983,7 +927,7 @@ _cvs_nonentried_files () {
 }
 
 (( $+functions[_cvs_nonexistent_entries] )) ||
-_cvs_nonexistent_entries () {
+_cvs_nonexistent_entries() {
   local expl match linedir realdir files
   match=()
   : ${PREFIX:#(#b)(*/)(*)}
@@ -1000,7 +944,7 @@ _cvs_nonexistent_entries () {
 }
 
 (( $+functions[_cvs_path_prefixes] )) ||
-_cvs_path_prefixes () {
+_cvs_path_prefixes() {
   local expl match
   match=()
   [[ "$PREFIX$SUFFIX" = (#b)(*)(/[^/]#) ]] && {
diff --git a/Completion/Unix/Command/_fakeroot b/Completion/Unix/Command/_fakeroot
index bb9655a85..f7a298cf2 100644
--- a/Completion/Unix/Command/_fakeroot
+++ b/Completion/Unix/Command/_fakeroot
@@ -1,7 +1,10 @@
 #compdef fakeroot
 
 _arguments \
-       '--lib[alternate wrapper library]:wrapper library:_files' \
-       '--faked[alternate faked binary]:fake binary: _command_names -e' \
-       '(-):command name: _command_names -e'  \
-       '*::arguments: _normal'
+  '(-l --lib)'{-l,--lib}'[specify alternate wrapper library]:wrapper library:_files' \
+  '--faked[specify alternate faked binary]:fake binary:_command_names -e' \
+  '-s[save the fakeroot environment on exit]:save file:_files' \
+  '-i[load a previously saved environment]:file:_files' \
+  '(-u --unknown-is-real)'{-u,--unknown-is-real}'[use real ownership of previously unknown files]' \
+  '(-):command name:_command_names -e'  \
+  '*::arguments:_normal'
diff --git a/Completion/Unix/Command/_fsh b/Completion/Unix/Command/_fsh
index a3ca0321a..d9ced5feb 100644
--- a/Completion/Unix/Command/_fsh
+++ b/Completion/Unix/Command/_fsh
@@ -1,25 +1,21 @@
 #compdef fsh
 
-local curcontext="$curcontext" state line
+local curcontext="$curcontext" state line ret=1
 
 _arguments -C \
-	'(--help)-h[help]' \
-	'(-h)--help' \
-	'(--version)-V[version]' \
-	'(-V)--version' \
-	'-r[method]:method:(rsh ssh)' \
-        '-l[login]:login:_users' \
-	'(--timeout)-T:idle timeout:' \
-	'(-T)--timeout:idle timeout:' \
-        ':remote host name:_hosts' \
-        '(-):command: _command_names -e' \
-        '*::args:->command' && return 0
+  '(- : *)'{-h,--help}'[display help information]' \
+  '(- : *)'{-V,--version}'[display version information]' \
+  '-r[specify method]:method:(rsh ssh)' \
+  '-l[specify login id]:login:_users' \
+  '(-T --timeout)'{-T,--timeout}':idle timeout:' \
+  ':remote host name:_hosts' \
+  '(-):command: _command_names -e' \
+  '*::args:->command' && ret=0
 
-case "$state" in
-      command)
-        shift 1 words
-        (( CURRENT-- ))
-        _normal
-        return
-        ;;
-esac
+if [[ -n "$state" ]]; then
+  shift 1 words
+  (( CURRENT-- ))
+  _normal && ret=0
+fi
+
+return ret
diff --git a/Completion/Unix/Command/_global b/Completion/Unix/Command/_global
index cbf8a7179..bb6f7a0fa 100644
--- a/Completion/Unix/Command/_global
+++ b/Completion/Unix/Command/_global
@@ -1,45 +1,29 @@
 #compdef global
 
+local cmds="(-c --completion -f --file -g --grep -I --idutils -p --print-dbpath -P --path -u --update --version --help)"
+
 _arguments \
-	'(--completion)-c[completion on prefix]:prefix:' \
-	'(-c)--completion:prefix:' \
-	'(--file)-f[print function definitions in file]' \
-	'(-f)--file' \
-	'(--grep)-g[print all lines which match pattern using grep]:pattern' \
-	'(-g)--grep' \
-	'(--idutils)-I[print all lines which match pattern using id-utils]:pattern' \
-	'(-I)--idutils' \
-	'(--print-dbpath)-p[print location of GTAGS]' \
-	'(-p)--print-dbpath' \
-	'(--path)-P[print paths matching pattern]:pattern:' \
-	'(-P)--path' \
-	'(--update)-u[locate tag files and update incrementally]' \
-	'(-u)--update' \
-	'(--absolute)-a[print absolute path names]' \
-	'(-a)--absolute' \
-	'(--ignore-case)-i[ignore case in patterns]' \
-	'(-i)--ignore-case' \
-	'(--local)-l[print just objects which exist under the current directory]' \
-	'(-l)--local' \
-	'(--nofilter)-n[suppress sort filter and path conversion filter]' \
-	'(-n)--nofilter' \
-	'(--other)-o[search in other files, not just source files (with -g)]' \
-	'(-o)--other' \
-	'(--quiet)-q[quiet mode]' \
-	'(-q)--quiet' \
-	'(--reference --rootdir)-r[find object references instead of definitions]' \
-	'(-r --rootdir)--rereference' \
-	'(-r --reference)--rootdir' \
-	'(--symbol)-s[find symbols instead of function names]:pattern:' \
-	'(-s)--symbol' \
-	'(--tags)-t[output in standard ctags format]' \
-	'(-t)--tags' \
-	'(--through -s -r -l)-T[search through all tag files in GTAGSLIBPATH]' \
-	'(-T -s -r -l)--through' \
-	'(--verbose)-v[verbose mode]' \
-	'(-v)--verbose' \
-	'(--cxref)-x[in addition to default output, list line number and contents]' \
-	'(-x)--cxref' \
-	'--version:show version number:' \
-	'--help:show help:' \
-	':word:_global_tags'
+  "$cmds"{-c,--completion}'[completion on prefix]:prefix:' \
+  "$cmds"{-f,--file}'[print function definitions in file]' \
+  "$cmds"{-g,--grep}'[print all lines which match pattern using grep]:pattern' \
+  "$cmds"{-I,--idutils}'[print all lines which match pattern using id-utils]:pattern' \
+  "$cmds"{-p,--print-dbpath}'[print location of GTAGS]' \
+  "$cmds"{-P,--path}'[print paths matching pattern]:pattern:' \
+  "$cmds"{-u,--update}'[locate tag files and update incrementally]' \
+  '(-a --absolute)'{-a,--absolute}'[print absolute path names]' \
+  '(-e --regexp :)'{-e,--regexp}'[specify pattern]:pattern:_global_tags' \
+  '(-G --basic-regexp :)'{-G,--basic-regexp}'[specify basic regexp to use]:word:_global_tags' \
+  '(-i --ignore-case)'{-i,--ignore-case}'[ignore case in patterns]' \
+  '(-l --local)'{-l,--local}'[print just objects which exist under the current directory]' \
+  '(-n --nofilter)'{-n,--nofilter}'[suppress sort filter and path conversion filter]' \
+  '(-o --other)'{-o,--other}'[search in other files, not just source files (with -g)]' \
+  '(-q --quiet)'{-q,--quiet}'[quiet mode]' \
+  '(-r --reference --rootdir)'{-r,--reference,--rootdir}'[find object references instead of definitions]' \
+  '(-s --symbol)'{-s,--symbol}'[find symbols instead of function names]:pattern' \
+  '(-t --tags)'{-t,--tags}'[output in standard ctags format]' \
+  '(-T --through -s -r -l)'{-T,--through}'[search through all tag files in GTAGSLIBPATH]' \
+  '(-v --verbose)'{-v,--verbose}'[verbose mode]' \
+  '(-x --cxref)'{-x,--cxref}'[additionally list line number and contents]' \
+  '(- :)--version[display version information]' \
+  '(- :)--help[display help information]' \
+  ':word:_global_tags'
diff --git a/Completion/Unix/Command/_global_tags b/Completion/Unix/Command/_global_tags
index bdd01baf6..9f7abdfa5 100644
--- a/Completion/Unix/Command/_global_tags
+++ b/Completion/Unix/Command/_global_tags
@@ -1,9 +1,4 @@
 #autoload
 
-local globalresults
-
-[[ -z $words[CURRENT] ]] && return 1
-
-globalresults=($(global --completion $words[CURRENT]))
-
-compadd -M 'm:{a-zA-Z}={A-Za-z}' -a "$@" - globalresults
+_wanted global-tags expl 'tag' compadd -M 'm:{a-zA-Z}={A-Za-z}' \
+    -a "$@" - $(_call_program global-tags global --completion $PREFIX)
diff --git a/Completion/Unix/Command/_imagemagick b/Completion/Unix/Command/_imagemagick
index eac3a2bf7..fd9780ad7 100644
--- a/Completion/Unix/Command/_imagemagick
+++ b/Completion/Unix/Command/_imagemagick
@@ -1,4 +1,4 @@
-#compdef display animate import identify montage convert combine mogrify xtp
+#compdef animate composite combine convert display identify import mogrify montage xtp
 
 local state line expl formats curcontext="$curcontext"
 typeset -A opt_args
@@ -19,227 +19,309 @@ if (( $# )); then
 fi
 
 case "$service" in
-display)
-  _arguments -M 'm:{a-z}={A-Z}' \
+  display)
+    _arguments -M 'm:{a-z}={A-Z}' \
       '*-backdrop[use full screen]' \
-      '*-border:border size (<width>x<height>):' \
-      '*-colormap:colormap type:(Shared Private)' \
-      '*-colors:preferred number of colors:' \
+      '*-background:color:_x_color' \
+      '*-border:border size (<width>x<height>)' \
+      '*-bordercolor:color:_x_color' \
+      '*-borderwidth:geometry' \
+      '*-cache[specify memory available to the pixel cache]:memory (MB)' \
+      '*-colormap:colormap type:(shared private)' \
+      '*-colors:preferred number of colors' \
       '*-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \
-      '*-comment:comment string:' \
+      '*-comment:comment string' \
       '*-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \
       '*-contrast[enhance contrast]' \
       '*+contrast[reduce contrast]' \
-      '*-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%}):' \
-      '*-delay:delay for next image (1/100ths of a second):' \
-      '*-density:resolution in pixels of image (<width>x<height>):' \
+      '*-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%%})' \
+      '*-debug' \
+      '*-delay:delay for next image (1/100ths of a second)' \
+      '*-density:image resolution (<width>x<height> in pixels)' \
       '*-despeckle[reduce speckles in image]' \
       '*-display:display:_x_display' \
       '*-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \
       '*-dither[apply dithering]' \
-      '*-edge:edge detection factor (0.0 - 99.9%):' \
+      '*-edge:edge detection factor (0.0 - 99.9%%)' \
+      '*-endian:image endianess:(MSB LSB)' \
+      '*+endian' \
       '*-enhance[enhance noisy image]' \
       '*-filter:filter type for resizing:(Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc)' \
       '*-flip[vertical mirror image]' \
       '*-flop[horizontal mirror image]' \
+      '*-font:_x_font' \
+      '*-foreground:color:_x_color' \
       '*-frame:border dimensions (<width>x<height>+<out>+<in>)' \
-      '*-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '*-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):' \
+      '*-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '*-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>})' \
+      '(- *)-help[display help information]' \
+      '*-iconGeometry:geometry:_x_geometry' \
+      '*-iconic' \
       '*-immutable[disallow image modifications]' \
       '*-interlace:interlacing scheme:(None Line Plane Partition)' \
-      '*-label:label string:' \
+      '*-label:label string' \
+      '*-magnify:factor' \
       '*-map:colormap type for display:(best default gray red green blue)' \
       '*-matte[store matte channel]' \
+      '*-mattecolor:color:_x_color' \
       '*-monochrome[transform to black and white]' \
+      '*-name:image name' \
       '*-negate[invert image]' \
       '*+negate[invert only grayscale]' \
-      '*-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
-      '*-quality:JPEG/MIFF/PNG compression level:' \
-      '*-raise:3-D edges (raised):' \
-      '*+raise:3-D edges (lowered):' \
+      '*-noop' \
+      '*-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
+      '*-quality:JPEG/MIFF/PNG compression level' \
+      '*-raise:3-D edges (raised)' \
+      '*+raise:3-D edges (lowered)' \
       '*-remote:remote command (file name):_imagemagick' \
-      '*-roll:image roll offset ({+-}<x>{+-}<y>):' \
-      '*-rotate:rotation (degrees{<}{>}):' \
-      '*-sample:scale factors (<width>x<height>):' \
-      '*-scene:image scene number:' \
-      '*-segment:cluster pixel number:' \
-      '*-sharpen:sharpening factor (0.0 - 99.9%):' \
-      '*-size:image size (<width>x<height>+<offset>):' \
+      '*-roll:image roll offset ({+-}<x>{+-}<y>)' \
+      '*-rotate:rotation (degrees{<}{>})' \
+      '*-sample:scale factors (<width>x<height>)' \
+      '*-sampling_factor:sampling factor (<horizontal_factor>x<vertical_factor>)' \
+      '*-scenes:image scene number' \
+      '*-segment:cluster pixel number' \
+      '*-shared_memory' \
+      '*-sharpen:sharpening factor (0.0 - 99.9%%)' \
+      '*-size:image size (<width>x<height>+<offset>)' \
+      '*-text_font:_x_font' \
       '*-texture:background texture image:_imagemagick' \
-      '*-update:redisplay test time (seconds):' \
-      '*-title:image title:' \
-      '*-treedepth:color reduction tree depth:' \
+      '*-title:image title' \
+      '*-treedepth:color reduction tree depth' \
+      '*-trim' \
+      '*-update:redisplay test time (seconds)' \
+      '*-use_pixmap' \
+      '*-verbose' \
       '*-visual:visual to use for display:(StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor default)' \
       '*-window:window ID to display image in:_x_window' \
+      '*-window_group' \
       '*-write:output filename:_files' \
       '*:picture file:_imagemagick' && return
   ;;
 
-animate)
-  _arguments -M 'm:{a-z}={A-Z}' \
+  animate)
+    _arguments -M 'm:{a-z}={A-Z}' \
       '*-backdrop[use full screen]' \
+      '*-background:color:_x_color' \
+      '*-bordercolor:color:_x_color' \
+      '*-borderwidth:geometry' \
+      '*-cache[specify memory available to the pixel cache]:memory (MB)' \
+      '*-chop:<width>x<height>{+-}<x>{+-}<y>' \
       '*-colormap:colormap type:(Shared Private)' \
-      '*-colors:preferred number of colors:' \
+      '*-colors:preferred number of colors' \
       '*-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \
-      '*-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%}):' \
-      '*-delay:delay for next image (1/100ths of a second):' \
-      '*-density:resolution in pixels of image (<width>x<height>):' \
+      '*-crop:crop image (<width>x<height>{+-}<x>{+-}<y>)' \
+      '*-debug' \
+      '*-delay:delay for next image (1/100ths of a second)' \
+      '*-density:image resolution (<width>x<height> in pixels)' \
+      '*-depth:image depth:(8 16)' \
       '*-display:display:_x_display' \
       '*-dither[apply dithering]' \
-      '*-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '*-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):' \
+      '*-font:_x_font' \
+      '*-foreground:color:_x_color' \
+      '*-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '*-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>})' \
+      '(- *)-help[display help information]' \
+      '*-iconGeometry:geometry:_x_geometry' \
+      '*-iconic' \
       '*-interlace:interlacing scheme:(None Line Plane Partition)' \
       '*-map:colormap type for display:(best default gray red green blue)' \
+      '*-matte[store matte channel]' \
+      '*-mattecolor:color:_x_color' \
       '*-monochrome[transform to black and white]' \
+      '*-name:image name' \
+      '*-noop' \
+      '*-pause:delay (seconds)' \
       '*-remote:remote command (file name):_imagemagick' \
-      '*-rotate:rotation (degrees{<}{>}):' \
-      '*-scene:image scene number:' \
-      '*-size:image size (<width>x<height>+<offset>):' \
-      '*-title:image title:' \
-      '*-treedepth:color reduction tree depth:' \
+      '*-rotate:rotation (degrees{<}{>})' \
+      '*-scenes:image scene number' \
+      '*-shared_memory' \
+      '*-size:image size (<width>x<height>+<offset>)' \
+      '*-text_font:_x_font' \
+      '*-title:image title' \
+      '*-treedepth:color reduction tree depth' \
+      '*-trim' \
       '*-verbose[print image information]' \
       '*-visual:visual to use for display:(StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor default)' \
       '*-window:window ID to display image in:_x_window' \
       '*:picture file:_imagemagick' && return
   ;;
 
-import)
-  _arguments -M 'm:{a-z}={A-Z}' \
+  import)
+    _x_arguments -M 'm:{a-z}={A-Z}' \
       '-adjoin[join images]' \
       '-border:border size (<width>x<height>):' \
-      '-colors:preferred number of colors:' \
+      '-bordercolor:color:_x_color' \
+      '-cache[specify memory available to the pixel cache]:memory (MB)' \
+      '-colors:preferred number of colors' \
       '-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \
-      '-comment:comment string:' \
-      '-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \
-      '-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%}):' \
-      '-delay:delay for next image (1/100ths of a second):' \
-      '-density:resolution in pixels of image (<width>x<height>):' \
+      '-comment:comment string' \
+      '-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%%})' \
+      '-debug' \
+      '-delay:delay for next image (1/100ths of a second)' \
+      '-density:resolution in pixels of image (<width>x<height>)' \
+      '-depth:image depth:(8 16)' \
       '-descend[descend window hierarchy]' \
-      '-display:display:_x_display' \
       '-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \
       '-dither[apply dithering]' \
+      '(+endian)-endian:image endianess:(MSB LSB)' \
+      '(-endian)+endian' \
       '-frame[include window manager frame]' \
-      '-geometry:image geometry (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):' \
+      '(- *)-help[display help information]' \
       '-interlace:interlacing scheme:(None Line Plane Partition)' \
+      '-label:label string' \
       '-monochrome[transform to black and white]' \
       '-negate[invert image]' \
       '+negate[invert only grayscale]' \
-      '-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
-      '-pointsize:Postscript font size:' \
-      '-quality:JPEG/MIFF/PNG compression level:' \
-      '-rotate:rotation (degrees{<}{>}):' \
-      '-scene:number of screen snapshots:' \
+      '-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
+      '-pause:delay (seconds)' \
+      '-ping' \
+      '-pointsize:Postscript font size' \
+      '-quality:JPEG/MIFF/PNG compression level' \
+      '-resize:size (<width>x<height>{%%}{@}{!}{<}{>})' \
+      '-rotate:rotation (degrees{<}{>})' \
+      '-sampling_factor:sampling factor (<horizontal_factor>x<vertical_factor>)' \
+      '-scene:number of screen snapshots' \
       '-screen[get root window]' \
       '-silent[be quiet]' \
-      '-transparency:transparent color:_x_color' \
-      '-treedepth:color reduction tree depth:' \
+      '-snaps:number' \
+      '-transparent:transparent color:_x_color' \
+      '-treedepth:color reduction tree depth' \
+      '-trim' \
+      '-type:image type:(Bilevel Grayscale Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte Optimize)' \
       '-verbose[print image information]' \
       '-window:window ID to get:_x_window' \
       ':output file:_files' && return
   ;;
 
-montage)
-  _arguments -M 'm:{a-z}={A-Z}' \
+  montage)
+    _arguments -M 'm:{a-z}={A-Z}' \
       '*-adjoin[join images]' \
-      '*-blur:blur factor (0.0 - 99.9%):' \
-      '*-colors:preferred number of colors:' \
+      '*-background:color:_x_color' \
+      '*-blur:blur factor (0.0 - 99.9%%)' \
+      '*-bordercolor:color:_x_color' \
+      '*-borderwidth:geometry' \
+      '*-cache[specify memory available to the pixel cache]:memory (MB)' \
+      '*-colors:preferred number of colors' \
       '*-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \
-      '*-comment:comment string:' \
+      '*-comment:comment string' \
       '*-compose:image composition type:(Over In Out Atop Xor Plus Minus Add Subtract Difference Bumpmap Replace ReplaceRed ReplaceGreen ReplaceBlue ReplaceMatte)' \
       '*-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \
-      '*-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%}):' \
-      '*-density:resolution in pixels of image (<width>x<height>):' \
+      '*-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%%})' \
+      '*-debug' \
+      '*-density:resolution in pixels of image (<width>x<height>)' \
+      '*-depth:image depth:(8 16)' \
       '*-display:display:_x_display' \
       '*-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \
       '*-dither[apply dithering]' \
       '*+dither[render Postscript without aliasing]' \
       '*-draw:drawing primitive:compadd -S "\\ " - rectangle circle ellipse polygon color matte text image' \
+      '*-endian:image endianess:(MSB LSB)' \
+      '*+endian' \
       '*-filter:filter type for resizing:(Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc)' \
       '*-frame[draw frame around image]' \
-      '*-frame[don'\''t draw frame around image]' \
       '*-font:annotation font:_x_font' \
-      '*-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '*-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):' \
+      '*-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '*-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>})' \
       '*-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \
+      '(- *)-help[display help information]' \
       '*-interlace:interlacing scheme:(None Line Plane Partition)' \
-      '*-label:label string:' \
+      '*-label:label string' \
       '*-matte[store matte channel]' \
+      '*-mattecolor:color:_x_color' \
       '*-mode:montage type:(Frame Unframe Concatenate)' \
       '*-monochrome[transform to black and white]' \
-      '*-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
+      '*-noop' \
+      '*-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
       '*-pen:font color:_x_color' \
-      '*-pointsize:Postscript font size:' \
-      '*-quality:JPEG/MIFF/PNG compression level:' \
-      '*-rotate:rotation (degrees{<}{>}):' \
-      '*-scene:image scene number:' \
+      '*-pointsize:Postscript font size' \
+      '*-quality:JPEG/MIFF/PNG compression level' \
+      '*-resize:size (<width>x<height>{%%}{@}{!}{<}{>})' \
+      '*-rotate:rotation (degrees{<}{>})' \
+      '*-sampling_factor:sampling factor (<horizontal_factor>x<vertical_factor>)' \
+      '*-scenes:image scene number' \
       '*-shadow[add shadow]' \
-      '*-sharpen:sharpening factor (0.0 - 99.9%):' \
-      '*-size:image size (<width>x<height>+<offset>):' \
+      '*-sharpen:sharpening factor (0.0 - 99.9%%)' \
+      '*-size:image size (<width>x<height>+<offset>)' \
+      '*-stroke:color:_x_color' \
       '*-texture:background texture image:_imagemagick' \
-      '*-tile:number of tiles (<width>x<height>):' \
-      '*-transparency:transparent color:_x_color' \
-      '*-treedepth:color reduction tree depth:' \
+      '*-tile:number of tiles (<width>x<height>)' \
+      '*-title:image title' \
+      '*-transparent:transparent color:_x_color' \
+      '*-treedepth:color reduction tree depth' \
+      '*-trim' \
+      '*-type:image type:(Bilevel Grayscale Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte Optimize)' \
       '*-verbose[print image information]' \
       '*:picture file:_imagemagick' && return
   ;;
 
-convert)
-  _arguments -C -M 'm:{a-z}={A-Z}' \
+  convert)
+    _arguments -C -M 'm:{a-z}={A-Z}' \
       '-adjoin[join images]' \
+      '-affine[drawing transform matrix]:matrix' \
       '-antialias[remove pixel aliasing]' \
       '-append[append image sequence]' \
       '-average[average image sequence]' \
-      '-blur:blur factor (0.0 - 99.9%):' \
-      '-border:border size (<width>x<height>):' \
+      '-background[specify background color]:color:_x_color' \
+      '-blur:blur factor (0.0 - 99.9%%)' \
+      '-border:border size (<width>x<height>)' \
       '-bordercolor:border color:_x_color' \
       '-box:annotation bounding box color:_x_color' \
-      '-charcoal:charcoal drawing factor:' \
-      '-coalesce[merge image sequence]:' \
-      '-colorize:colorization amount (<num> or <red>/<green>/<blue>):' \
-      '-colors:preferred number of colors:' \
+      '-cache[specify memory available to the pixel cache]:memory (MB)' \
+      '-channel:channel:(Red Green Blue Opacity Cyan Magenta Yellow Black)' \
+      '-charcoal:charcoal drawing factor' \
+      '-chop:<width>x<height>{+-}<x>{+-}<y>' \
+      '-clip' \
+      '-coalesce[merge image sequence]' \
+      '-colorize:colorization amount (<num> or <red>/<green>/<blue>)' \
+      '-colors:preferred number of colors' \
       '-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \
-      '-comment:comment string:' \
+      '-comment:comment string' \
       '-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \
       '-contrast[enhance contrast]' \
       '+contrast[reduce contrast]' \
-      '-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%}):' \
-      '-cycle:image colormap shift:' \
+      '-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%%})' \
+      '-cycle:image colormap shift' \
+      '-debug' \
       '-deconstruct[break down image sequence into parts]' \
-      '-delay:delay for next image (1/100ths of a second):' \
-      '-density:resolution in pixels of image (<width>x<height>):' \
+      '-delay:delay for next image (1/100ths of a second)' \
+      '-density:resolution in pixels of image (<width>x<height>)' \
       '-depth:image depth:(8 16)' \
       '-despeckle[reduce speckles in image]' \
       '-display:display:_x_display' \
       '-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \
       '-dither[apply dithering]' \
       '-draw:drawing primitive:compadd -S "\\ " - rectangle circle ellipse polygon color matte text image' \
-      '-edge:edge detection factor (0.0 - 99.9%):' \
+      '-edge:edge detection factor (0.0 - 99.9%%)' \
       '-emboss[emboss image]' \
+      '(+endian)-endian:image endianess:(MSB LSB)' \
+      '(-endian)+endian' \
       '-enhance[enhance image]' \
       '-equalize[histogram equalization]' \
+      '-fill[specify color to use when filling a graphic primitive]:color:_x_color' \
       '-filter:filter type for resizing:(Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc)' \
+      '-flatten[flatten a sequence of images]' \
       '-flip[vertical mirror image]' \
       '-flop[horizontal mirror image]' \
       '-font:annotation font:_x_font' \
       '-frame:border dimensions (<width>x<height>+<out>+<in>)' \
-      '-fuzz:maximum distance for equal colors:' \
-      '-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):' \
+      '-fuzz:maximum distance for equal colors' \
+      '-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>})' \
       '-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \
-      '-implode:implosion factor (0.0 - 99.9%):' \
+      '-implode:implosion factor (0.0 - 99.9%%)' \
       '-interlace:interlacing scheme:(None Line Plane Partition)' \
-      '-label:label string:' \
+      '-label:label string' \
       '-layer:layer type:(Red Green Blue Matte)' \
-      '-linewidth:line width:' \
-      '-loop:number of iterations (GIF animation):' \
+      '-linewidth:line width' \
+      '-loop:number of iterations (GIF animation)' \
       '-map[single image colormap file]:picture file for colors:_imagemagick' \
       '+map[all images colormap file]:picture file for colors:_imagemagick' \
       '-matte[store matte channel]' \
-      '-modulate:<brightness>,<saturation>,<hue>:' \
+      '-modulate:<brightness>,<saturation>,<hue>' \
       '-monochrome[transform to black and white]' \
       '-morph[morph image sequence]' \
       '-negate[invert image]' \
@@ -248,37 +330,37 @@ convert)
       '+noise:noise type:(Uniform Gaussian Multiplicative Impulse Laplacian Poisson)' \
       '-normalize[use full color value range]' \
       '-opaque:image pen color:_x_color' \
-      '-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
-      '-paint:oil painting radius:' \
+      '-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
+      '-paint:oil painting radius' \
       '-pen:font color:_x_color' \
-      '-pointsize:Postscript font size:' \
+      '-pointsize:Postscript font size' \
       '-preview:image preview type:(Rotate Shear Roll Hue Saturation Brightness Gamma Spiff Dull Grayscale Quantize Despeckle ReduceNoise AddNoise Sharpen Blur Threshold Edge Detect Spread Shade Raise Segment Solarize Swirl Implode Wave OilPaint CharcoalDrawing JPEG)' \
       '-profile:information profile:->profile' \
-      '-quality:JPEG/MIFF/PNG compression level:' \
-      '-raise:lighten or darken edges (<width>x<height>):' \
-      '-region:image region (<width>x<height>{+-}<x>{+-}<y>):' \
-      '-roll:image roll offset ({+-}<x>{+-}<y>):' \
-      '-rotate:rotation (degrees{<}{>}):' \
-      '-sample:scale factors (<width>x<height>):' \
-      '-scene:image scene number:' \
-      '-seed:random number seed:' \
-      '-segment:segment thresholds (<cluster>x<smoothing>):' \
-      '-shade:image shading (<azimuth>x<elevation>):' \
-      '-sharpen:sharpening factor (0.0 - 99.9%):' \
-      '-shear:shearing angles (<x>x<y> in degrees):' \
-      '-size:image size (<width>x<height>+<offset>):' \
-      '-solarize:solarization threshold:' \
-      '-spread:neighborhood size:' \
-      '-swirl:swirl tightness:' \
+      '-quality:JPEG/MIFF/PNG compression level' \
+      '-raise:lighten or darken edges (<width>x<height>)' \
+      '-region:image region (<width>x<height>{+-}<x>{+-}<y>)' \
+      '-roll:image roll offset ({+-}<x>{+-}<y>)' \
+      '-rotate:rotation (degrees{<}{>})' \
+      '-sample:scale factors (<width>x<height>)' \
+      '-scene:image scene number' \
+      '-seed:random number seed' \
+      '-segment:segment thresholds (<cluster>x<smoothing>)' \
+      '-shade:image shading (<azimuth>x<elevation>)' \
+      '-sharpen:sharpening factor (0.0 - 99.9%%)' \
+      '-shear:shearing angles (<x>x<y> in degrees)' \
+      '-size:image size (<width>x<height>+<offset>)' \
+      '-solarize:solarization threshold' \
+      '-spread:neighborhood size' \
+      '-swirl:swirl tightness' \
       '-texture:background texture image:_imagemagick' \
-      '-threshold:threshold for maximum intensity:' \
+      '-threshold:threshold for maximum intensity' \
       '-transparency:transparent color:_x_color' \
-      '-treedepth:color reduction tree depth:' \
+      '-treedepth:color reduction tree depth' \
       '-units:image resolution type:(Undefined PixelsPerInch PixelsPerCentimeter)' \
       '-verbose[print image information]' \
-      '-view:FlashPix viewing parameters:' \
-      '-wave:sine wave parameters (<amplitude>x<wavelength>):' \
-      '*:picture file:_imagemagick' && return 0
+      '-view:FlashPix viewing parameters' \
+      '-wave:sine wave parameters (<amplitude>x<wavelength>)' \
+      '*:picture file:_imagemagick' && return
 
     if [[ "$state" = profile ]]; then
       if compset -P '*:'; then
@@ -290,36 +372,36 @@ convert)
     fi
   ;;
 
-combine)
-  _arguments -M 'm:{a-z}={A-Z}' \
-      '-blend:blending factor (0.0 - 99.9%):' \
-      '-colors:preferred number of colors:' \
+  combine|composite)
+    _arguments -M 'm:{a-z}={A-Z}' \
+      '-blend:blending factor (0.0 - 99.9%%)' \
+      '-colors:preferred number of colors' \
       '-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \
-      '-comment:comment string:' \
+      '-comment:comment string' \
       '-compose:image composition type:(Over In Out Atop Xor Plus Minus Add Subtract Difference Bumpmap Replace ReplaceRed ReplaceGreen ReplaceBlue ReplaceMatte)' \
       '-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \
-      '-density:resolution in pixels of image (<width>x<height>):' \
-      '-displace:displacements scales (<horizontal>x<vertical>):' \
+      '-density:resolution in pixels of image (<width>x<height>)' \
+      '-displace:displacements scales (<horizontal>x<vertical>)' \
       '-display:display:_x_display' \
       '-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \
       '-dither[apply dithering]' \
       '+dither[render Postscript without aliasing]' \
       '-font:normal text font:_x_font' \
-      '-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):' \
+      '-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>})' \
       '-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \
       '-interlace:interlacing scheme:(None Line Plane Partition)' \
-      '-label:label string:' \
+      '-label:label string' \
       '-matte[store matte channel]' \
       '-monochrome[transform to black and white]' \
       '-negate[invert image]' \
       '+negate[invert only grayscale]' \
-      '-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
-      '-quality:JPEG/MIFF/PNG compression level:' \
-      '-scene:image scene number:' \
-      '-stegano:watermark offset:' \
+      '-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
+      '-quality:JPEG/MIFF/PNG compression level' \
+      '-scene:image scene number' \
+      '-stegano:watermark offset' \
       '-stereo[create stereo anaglyph]' \
       '-tile[repeat composite operation]' \
-      '-treedepth:color reduction tree depth:' \
+      '-treedepth:color reduction tree depth' \
       '-verbose[print image information]' \
       ':image file:_imagemagick' \
       ':composite file:_imagemagick' \
@@ -327,25 +409,27 @@ combine)
       ':combined file:_files' && return
   ;;
 
-mogrify)
-  _arguments -M 'm:{a-z}={A-Z}' \
+  mogrify)
+    _arguments -M 'm:{a-z}={A-Z}' \
+      '*-affine[drawing transform matrix]:matrix' \
       '*-antialias[remove pixel aliasing]' \
-      '*-blur:blur factor (0.0 - 99.9%):' \
-      '*-border:border size (<width>x<height>):' \
+      '*-background[specify background color]:color:_x_color' \
+      '*-blur:blur factor (0.0 - 99.9%%)' \
+      '*-border:border size (<width>x<height>)' \
       '*-bordercolor:border color:_x_color' \
       '*-box:annotation bounding box color:_x_color' \
-      '*-charcoal:charcoal drawing factor:' \
-      '*-colorize:colorization amount (<num> or <red>/<green>/<blue>):' \
-      '*-colors:preferred number of colors:' \
+      '*-charcoal:charcoal drawing factor' \
+      '*-colorize:colorization amount (<num> or <red>/<green>/<blue>)' \
+      '*-colors:preferred number of colors' \
       '*-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \
-      '*-comment:comment string:' \
+      '*-comment:comment string' \
       '*-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \
       '*-contrast[enhance contrast]' \
       '*+contrast[reduce contrast]' \
-      '*-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%}):' \
-      '*-cycle:image colormap shift:' \
-      '*-delay:delay for next image (1/100ths of a second):' \
-      '*-density:resolution in pixels of image (<width>x<height>):' \
+      '*-crop:crop image (<width>x<height>{+-}<x>{+-}<y>{%%})' \
+      '*-cycle:image colormap shift' \
+      '*-delay:delay for next image (1/100ths of a second)' \
+      '*-density:resolution in pixels of image (<width>x<height>)' \
       '*-depth:image depth:(8 16)' \
       '*-despeckle[reduce speckles in image]' \
       '*-display:display:_x_display' \
@@ -353,7 +437,7 @@ mogrify)
       '*-dither[apply dithering]' \
       '*+dither[render Postscript without aliasing]' \
       '*-draw:drawing primitive:compadd -S "\\ " - point line rectangle fillRectangle circle fillCircle ellipse fillEllipse polygon fillPolygon color matte text image' \
-      '*-edge:edge detection factor (0.0 - 99.9%):' \
+      '*-edge:edge detection factor (0.0 - 99.9%%)' \
       '*-emboss[emboss image]' \
       '*-enhance[enhance image]' \
       '*-equalize[histogram equalization]' \
@@ -363,20 +447,20 @@ mogrify)
       "*-format:output file format:(${formats//:/ })" \
       '*-font:annotation font:_x_font' \
       '*-frame:border dimensions (<width>x<height>+<out>+<in>)' \
-      '*-fuzz:maximum distance for equal colors:' \
-      '*-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>):' \
-      '*-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):' \
+      '*-fuzz:maximum distance for equal colors' \
+      '*-gamma[gamma correction level]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level (<n> or <red>/<green>/<blue>)' \
+      '*-geometry:window geometry (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>})' \
       '*-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \
-      '*-implode:implosion factor (0.0 - 99.9%):' \
+      '*-implode:implosion factor (0.0 - 99.9%%)' \
       '*-interlace:interlacing scheme:(None Line Plane Partition)' \
       '*-layer:layer type:(Red Green Blue Matte)' \
-      '*-linewidth:line width:' \
-      '*-loop:number of iterations (GIF animation):' \
+      '*-linewidth:line width' \
+      '*-loop:number of iterations (GIF animation)' \
       '*-map[single image colormap file]:picture file for colors:_imagemagick' \
       '*+map[all images colormap file]:picture file for colors:_imagemagick' \
       '*-matte[store matte channel]' \
-      '*-modulate:<brightness>,<saturation>,<hue>:' \
+      '*-modulate:<brightness>,<saturation>,<hue>' \
       '*-monochrome[transform to black and white]' \
       '*-negate[invert image]' \
       '*+negate[invert only grayscale]' \
@@ -384,45 +468,45 @@ mogrify)
       '*+noise:noise type:(Uniform Gaussian Multiplicative Impulse Laplacian Poisson)' \
       '*-normalize[use full color value range]' \
       '*-opaque:image pen color:_x_color' \
-      '*-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
-      '*-paint:oil painting radius:' \
+      '*-page:geometry of image canvas (<width>x<height>{+-}<x>{+-}<y>{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \
+      '*-paint:oil painting radius' \
       '*-pen:font color:_x_color' \
-      '*-pointsize:Postscript font size:' \
-      '*-quality:JPEG/MIFF/PNG compression level:' \
-      '*-raise:lighten or darken edges (<width>x<height>):' \
-      '*-region:image region (<width>x<height>{+-}<x>{+-}<y>):' \
-      '*-resize:size (<width>x<height>{%}{@}{!}{<}{>}):' \
-      '*-roll:image roll offset ({+-}<x>{+-}<y>):' \
-      '*-rotate:rotation (degrees{<}{>}):' \
-      '*-sample:scale factors (<width>x<height>):' \
-      '*-scene:image scene number:' \
-      '*-seed:random number seed:' \
-      '*-segment:segment thresholds (<cluster>x<smoothing>):' \
-      '*-shade:image shading (<azimuth>x<elevation>):' \
-      '*-sharpen:sharpening factor (0.0 - 99.9%):' \
-      '*-shave:shave edges (<width>x<height>{%}):' \
-      '*-shear:shearing angles (<x>x<y> in degrees):' \
-      '*-size:image size (<width>x<height>+<offset>):' \
-      '*-solarize:solarization threshold:' \
-      '*-spread:neighborhood size:' \
-      '*-swirl:swirl tightness:' \
+      '*-pointsize:Postscript font size' \
+      '*-quality:JPEG/MIFF/PNG compression level' \
+      '*-raise:lighten or darken edges (<width>x<height>)' \
+      '*-region:image region (<width>x<height>{+-}<x>{+-}<y>)' \
+      '*-resize:size (<width>x<height>{%%}{@}{!}{<}{>})' \
+      '*-roll:image roll offset ({+-}<x>{+-}<y>)' \
+      '*-rotate:rotation (degrees{<}{>})' \
+      '*-sample:scale factors (<width>x<height>)' \
+      '*-scene:image scene number' \
+      '*-seed:random number seed' \
+      '*-segment:segment thresholds (<cluster>x<smoothing>)' \
+      '*-shade:image shading (<azimuth>x<elevation>)' \
+      '*-sharpen:sharpening factor (0.0 - 99.9%%)' \
+      '*-shave:shave edges (<width>x<height>{%%})' \
+      '*-shear:shearing angles (<x>x<y> in degrees)' \
+      '*-size:image size (<width>x<height>+<offset>)' \
+      '*-solarize:solarization threshold' \
+      '*-spread:neighborhood size' \
+      '*-swirl:swirl tightness' \
       '*-texture:background texture image:_imagemagick' \
-      '*-threshold:threshold for maximum intensity:' \
+      '*-threshold:threshold for maximum intensity' \
       '*-transparency:transparent color:_x_color' \
-      '*-treedepth:color reduction tree depth:' \
+      '*-treedepth:color reduction tree depth' \
       '*-units:image resolution type:(Undefined PixelsPerInch PixelsPerCentimeter)' \
       '*-verbose[print image information]' \
-      '*-view:FlashPix viewing parameters:' \
-      '*-wave:sine wave parameters (<amplitude>x<wavelength>):' \
+      '*-view:FlashPix viewing parameters' \
+      '*-wave:sine wave parameters (<amplitude>x<wavelength>)' \
       '*:picture file:_imagemagick' && return
   ;;
 
-xtp)
-  _arguments -M 'm:{a-z}={A-Z}' \
-      '-account:password:' \
+  xtp)
+    _arguments -M 'm:{a-z}={A-Z}' \
+      '-account:password' \
       '-binary[retrieve files as binary]' \
       '-directory[list directory]' \
-      '-exclude:regular expression for exclusion:' \
+      '-exclude:regular expression for exclusion' \
       '-file:output file:_files' \
       '-get[get files]' \
       '-port:port: _ports' \
@@ -431,23 +515,25 @@ xtp)
       '-prune[process files from remote directory]' \
       '-put[put files]' \
       '-retrieve[retrieve matching files]' \
-      '-timeout:maximum timeout:' \
+      '-timeout:maximum timeout' \
       '-type:remote system type:(UNIX VMS other)' \
       ':url: _urls' && return
   ;;
 
-identify)
-  _arguments \
-      '*-density:resolution in pixels of image (<width>x<height>):' \
+  identify)
+    _arguments \
+      '*-cache[specify memory available to the pixel cache]:memory (MB)' \
+      '*-debug' '*-ping' \
+      '*-density:resolution in pixels of image (<width>x<height>)' \
       '*-depth[specify image depth]:image depth:(8 16)' \
-      '*-size:image size (<width>x<height>+<offset>):' \
+      '*-format[specify format for image characteristics]:format' \
+      '(- *)-help[display help information]' \
+      '*-size:image size (<width>x<height>+<offset>)' \
       '*-verbose[print more detailed info about image]' \
-      '*-noop[disable effect of preceding options]' \
       '*:picture file:_imagemagick' && return
- ;;
+   ;;
 
-*)
-  _message 'eh?'
+  *) _message 'eh?' ;;
 esac
 
 return 1
diff --git a/Completion/Unix/Command/_irssi b/Completion/Unix/Command/_irssi
index d84812010..81735cd2b 100644
--- a/Completion/Unix/Command/_irssi
+++ b/Completion/Unix/Command/_irssi
@@ -1,45 +1,36 @@
 #compdef irssi
 
-typeset -A opt_args
-
 local expl
 
 _irssi_servers() {
-		local a
-		a=($(grep "\(^[{ 	]*address\)\|\([{ 	]address\)[ 	]*=" ~/.irssi/config | sed -e "s,^.*address *= *\"\([^\"]\+\).*,\1 ,g"))
-		compadd -x 'use "--help" to get descriptions' $a[@]
-		}
+  local a
+  a=( $(grep "\(^[{ 	]*address\)\|\([{ 	]address\)[ 	]*=" ~/.irssi/config | sed -e "s,^.*address *= *\"\([^\"]\+\).*,\1 ,g") )
+  _wanted irc-servers expl 'irc server' compadd "$@" -a - a
+}
 
 _irssi_ports() {
-		local a
-		a=($(grep "\(^[{ 	]*port\)\|\([{ 	]port\)[ 	]*=" ~/.irssi/config | sed -e "s,^.*port *= *\"\([^\"]\+\).*,\1,g"))
-		compadd -x 'use "--help" to get descriptions' $a[@]
-		}
+  local a
+  a=( $(grep "\(^[{ 	]*port\)\|\([{ 	]port\)[ 	]*=" ~/.irssi/config | sed -e "s,^.*port *= *\"\([^\"]\+\).*,\1,g") )
+  _wanted ports expl 'port' compadd "$@" -a - a
+}
 
 _irssi_nick() {
-		local a
-		a=($(grep "\(^[{ 	]*nick\)\|\([{ 	]nick\)\|\([{ 	]alternate_nick\)\|\(^[{ 	]*alternate_nick\)[ 	]*=" ~/.irssi/config | sed -e "s,^.*nick *= *\"\([^\"]\+\).*,\1,g"))
-		compadd -x 'use "--help" to get descriptions' $a[@]
-		}
+  local a
+  a=( $(grep "\(^[{ 	]*nick\)\|\([{ 	]nick\)\|\([{ 	]alternate_nick\)\|\(^[{ 	]*alternate_nick\)[ 	]*=" ~/.irssi/config | sed -e "s,^.*nick *= *\"\([^\"]\+\).*,\1,g") )
+  _wanted nicknames expl 'nick' compadd "$@" -a - a
+}
 
-_arguments -C -s \
-	"--config=[config file]:config:_files" \
-	"--home=[home dir location]:home:_dir_list" \
-	"-c[connect to servers]:irc servers: _irssi_servers" \
-	"--connect=[connect to servers]:irc servers: _irssi_servers" \
-	'-w[password]' \
-	'--password=[password]' \
-	"-p[specify a port]:port: _irssi_ports" \
-	"--port=[specify a port]:port: _irssi_ports" \
-	'-![disable autoconnect]' \
-	'--noconnect[disable autoconnect]' \
-	"-n[set nick name]:nick: _irssi_nick" \
-	"--nick=[set nick name]:nick: _irssi_nick" \
-	'-h[hostname]' \
-	'--hostname=[hostname]' \
-	'-v[version]' \
-	'--version[version]' \
-	'-?[help message]' \
-	'--help[help message]' \
-	'--usage[display usage]' \
+_arguments -s \
+  '--config=[config file]:config:_files' \
+  '--home=[home dir location]:home:_dir_list' \
+  '(-c --connect)'{-c,--connect=}'[connect to servers]:irc server:_irssi_servers' \
+  '(-w --password)'{-w,--password=}'[password]:password' \
+  '(-p --port)'{-p,--port=}'[specify a port]:port:_irssi_ports' \
+  '-![disable autoconnect]' \
+  '--noconnect[disable autoconnect]' \
+  '(-n --nick)'{-n,--nick=}'[set nick name]:nick:_irssi_nick" \
+  '(-h --hostname)'{-h,--hostname=}'[specify hostname]:hostname:_hosts' \
+  '(-)'{-v,--version}'[display version information]' \
+  '(-)'{-\?,--help}'[display help information]' \
+  '(-)--usage[display usage]' \
 
diff --git a/Completion/Unix/Command/_mysql_utils b/Completion/Unix/Command/_mysql_utils
index 1fb4dc689..547a17b2e 100644
--- a/Completion/Unix/Command/_mysql_utils
+++ b/Completion/Unix/Command/_mysql_utils
@@ -1,23 +1,19 @@
 #compdef mysql mysqlshow mysqldump mysqladmin
-#
-# zsh completion functions for mysql client programs
+
 # Adam Spiers <adam@spiers.net>
-#
 
-##
-## Auxiliary functions
-##
+# Auxiliary functions
 
 _mysql_get_identity () {
-  _mysql_user=${opt_args[-u]-$opt_args[--user]}
-  _mysql_port=${opt_args[-P]-$opt_args[--port]}
-  _mysql_host=${opt_args[-h]-$opt_args[--host]}
+  _mysql_user=${(v)opt_args[(i)-u|--user]}
+  _mysql_port=${(v)opt_args[(i)-P|--port]}
+  _mysql_host=${(v)opt_args[(i)-h|--host]}
 
   _mysql_params=(
-                 ${_mysql_user:+"--user=$_mysql_user"}
-                 ${_mysql_host:+"--host=$_mysql_host"}
-                 ${_mysql_port:+"--port=$_mysql_port"}
-                )
+    ${_mysql_user:+"--user=$_mysql_user"}
+    ${_mysql_host:+"--host=$_mysql_host"}
+    ${_mysql_port:+"--port=$_mysql_port"}
+  )
 }
 
 _mysql_hosts () {
@@ -57,29 +53,16 @@ _mysql_databases () {
   local _mysql_user _mysql_port _mysql_host _mysql_params
   _mysql_get_identity
 
-  local _mysql_databases
-  _mysql_databases=(
-                    ${(f)~~"$( echo "show databases" |
-                               mysql "$_mysql_params[@]" )"}
-                   )
-  shift _mysql_databases
-
-  compadd "$expl[@]" -a _mysql_databases
+  compadd "$@" - ${${(f)~~"$(_call_program databases \
+      mysql "$_mysql_params[@]" <<<'show databases' 2>/dev/null)"}[2,-1]}
 }
 
 _mysql_tables () {
   local _mysql_user _mysql_port _mysql_host _mysql_params
   _mysql_get_identity
 
-  local _mysql_tables
-  _mysql_tables=(
-                 ${(f)~~"$( echo "show tables" |
-                              mysql "$_mysql_params[@]" $1 )"}
-                )
-  # remove header
-  shift _mysql_tables
-
-  compadd "$expl[@]" -a _mysql_tables
+  compadd "$@" - ${${(f)~~"$(_call_program tables \
+      mysql "$_mysql_params[@]" $1 <<< 'show tables' 2>/dev/null)"}[2,-1]}
 }
 
 _mysql_variables () {
@@ -89,27 +72,12 @@ _mysql_variables () {
 }
 
 
-##
-## The actual completion code for the commands
-##
-
-_mysql_common_opts=(
-    {-\?,--help}'[display help]'
-    {-S+,--socket=}':server socket file:_files'
-    {-h+,--host=}':server hostname:_mysql_hosts'
-    {-P+,--port=}':server port:_mysql_ports'
-    {-u+,--user=}':server username:_mysql_users'
-    {-p+,--password=}':server password: '
-    {-C,--compress}'[use compression in server/client protocol]'
-)
+# The actual completion code for the commands
 
 _mysql () {
-  local curcontext="$curcontext" state line expl
-  typeset -A opt_args
-
-  _arguments -C -s \
+  _arguments -s \
     "$_mysql_common_opts[@]" \
-    {-V,--version}'[display client version]' \
+    '(- :)'{-V,--version}'[display client version]' \
     {-A,--no-auto-rehash}'[no automatic rehashing]' \
     '(-t --table)'{-B,--batch}'[batch mode (no pretty ASCII)]' \
     {-T,--debug-info}'[print debug info on exit]' \
@@ -129,14 +97,11 @@ _mysql () {
     {-v,--verbose}'[verbose mode]' \
     {-E,--vertical}'[print query output vertically]' \
     {-w,--wait}'[wait and retry server connection if necessary]' \
-    ':MySQL database to use:_mysql_databases'
+    ':MySQL database:_mysql_databases'
 }
 
 _mysqlshow () {
-  local curcontext="$curcontext" state line expl
-  typeset -A opt_args
-
-  _arguments -C -s \
+  _arguments -s \
     "$_mysql_common_opts[@]" \
     {-V,--version}'[display version]' \
     {-\#+,--debug=}':debug file: ' \
@@ -146,10 +111,7 @@ _mysqlshow () {
 }
 
 _mysqldump () {
-  local curcontext="$curcontext" state line expl
-  typeset -A opt_args
-
-  _arguments -C -s \
+  _arguments -s \
     "$_mysql_common_opts[@]" \
     {-V,--version}'[display version]' \
     {-a,--all}'[include all create options]' \
@@ -179,51 +141,59 @@ _mysqldump () {
 }
 
 _mysqladmin () {
-  local curcontext="$curcontext" state line expl
+  local curcontext="$curcontext" state line expl ret=1
   typeset -A opt_args
 
   _arguments -C -s \
     "$_mysql_common_opts[@]" \
-    {-v,--version}'[display version]' \
-    {-\#+,--debug=}':debug file: ' \
-    {-f,--force}'[continue through errors]' \
-    {-i+,--sleep=}'[repeat commands periodically]:number of seconds between executions: ' \
-    {-s,--silent}"[silently exit if can't connect to server]" \
-    {-t+,--timeout=}'[timeout for connection]' \
-    {-w+,--wait=}'[wait and retry server connection if necessary]:number of retries: ' \
-    '*::admin command:_mysqladmin_commands'
-}
-
-_mysqladmin_commands () {
-  local cmds expl
-  cmds=(
-        create drop extended-status
-        flush-{hosts,logs,status,tables,privileges}
-        kill password ping processlist
-        reload refresh shutdown
-        status variables version
-       )
-
-  if (( CURRENT == 1 )); then
-    _wanted commands expl command compadd "$@" -a cmds
-  else
-    local curcontext="$curcontext"
-
-    case "${words[1]:t}" in
-      (create|drop)
-        _wanted mysqldbs expl "MySQL databases" _mysql_databases
-      ;;
-      (kill)
-        _message -e ids 'thread ids'
-      ;;
-      (password)
-        _message -e passwords 'new password'
-      ;;
-    esac
+    '(- *)'{-v,--version}'[display version]' \
+    '(-\# --debug)'{-\#+,--debug=}'[output debug log]:debug file' \
+    '(-f --force)'{-f,--force}'[continue through errors]' \
+    '(-i --sleep)'{-i+,--sleep=}'[repeat commands periodically]:number of seconds between executions: ' \
+    '(-s --silent)'{-s,--silent}"[silently exit if can't connect to server]" \
+    '(-t --timeout)'{-t+,--timeout=}'[specify timeout for connection]:time (seconds)' \
+    '(-w --wait)'{-w+,--wait=}'[wait and retry server connection if necessary]:number of retries' \
+    '*::mysqladmin command:->mysqladmin-commands' && ret=0
+
+  if [[ -n "$state" ]]; then
+    if (( CURRENT == 1 )); then
+      _wanted commands expl 'mysqladmin command' compadd - \
+	  create drop extended-status \
+	  flush-{hosts,logs,status,tables,privileges} \
+	  kill password ping processlist \
+	  reload refresh shutdown \
+	  status variables version && ret=0
+    else
+      case "${words[1]:t}" in
+	create|drop)
+	  _wanted databases expl "MySQL databases" _mysql_databases && ret=0
+	;;
+	kill)
+	  _message -e ids 'thread ids'
+	;;
+	password)
+	  _message -e passwords 'new password'
+	;;
+      esac
+    fi
   fi
+
+  return ret
 }
 
 _mysql_utils () {
+  local _mysql_common_opts
+
+  _mysql_common_opts=(
+    '(-)'{-\?,--help}'[display help]'
+    '(-S --socket)'{-S+,--socket=}'[specify socket file to use for connection]:server socket file:_files'
+    '(-h --host)'{-h+,--host=}'[specify server hostname]:hostname:_mysql_hosts'
+    '(-P,--port)'{-P+,--port=}'[specify port number for connection]:server port:_mysql_ports'
+    '(-u --user)'{-u+,--user=}'[specify username for login]:server username:_mysql_users'
+    '(-p --password)'{-p+,--password=}'[specify password to use for connection]:server password'
+    '(-C --compress)'{-C,--compress}'[use compression in server/client protocol]'
+  )
+
   case "$service" in
     mysql)
       _mysql "$@"
diff --git a/Completion/Unix/Command/_pbm b/Completion/Unix/Command/_pbm
index c33e09140..17963c1e7 100644
--- a/Completion/Unix/Command/_pbm
+++ b/Completion/Unix/Command/_pbm
@@ -15,8 +15,8 @@ elif [[ "$service" = *top[bgpn]m ]]; then
 else
   pat="*.(#i)${service[1,3]}"
 fi
-  
-if [[ $# -ne 0 || $+_in_pbm -ne 0 ]]; then
+
+if (( $# + $+_in_pbm )); then
   _wanted files expl 'picture file' _path_files "$@" -g "$pat" - ||
       _files "$@" "$expl[@]" -g '*.(#i)p[bgp]m'
   return
@@ -27,25 +27,25 @@ local _in_pbm=yes
 case "$service" in
 asciitop[gn]m)
   _arguments \
-    '-d[specify divisor]:divisor:' \
-    ':height:' ':width:' ':file: _pbm'
+    '-d[specify divisor]:divisor' \
+    ':height' ':width' ':file:_pbm'
   ;;
 
 fitstopgm)
   _arguments \
-    '-image[specify image number]:image number:' \
-    ':file: _pbm'
+    '-image[specify image number]:image number' \
+    ':file:_pbm'
   ;;
 
 fitstopnm)
   _arguments \
-    '-image[specify image number]:image number:' \
+    '-image[specify image number]:image number' \
     '-noraw[produce ASCII pnm file]' \
     '(-min -max)-scanmax[force scanning data for minimum and maximum]' \
     '-printmax[only print minimum and maximum values]' \
-    '(-scanmax)-min[override minimum value]:minimum value:' \
-    '(-scanmax)-max[override maximum value]:maximum value:' \
-    ':file: _pbm'
+    '(-scanmax)-min[override minimum value]:minimum value' \
+    '(-scanmax)-max[override maximum value]:maximum value' \
+    ':file:_pbm'
   ;;
 
 g3topbm)
@@ -53,18 +53,30 @@ g3topbm)
     '-kludge[ignore first few lines]' \
     '-reversebits[interpret bits least-significant first]' \
     '-stretch[duplicate each row]' \
-    ':file: _pbm'
+    ':file:_pbm'
   ;;
 
 giftopnm)
   _arguments \
+    '-alphaout=[output alpha channel]:file:_pbm' \
     '-verbose[verbose mode]' \
     '-comments[only print comment fields]' \
-    '-image[specify image number]:image number:' \
-    ':file: _pbm'
+    '-image[specify image number]:image number' \
+    ':file:_pbm'
+  ;;
+
+jpegtopnm)
+  _arguments \
+    '-dct:dct method:(int fast float)' \
+    -{nosmooth,adobe,notadobe,dumpexif,comments,verbose} \
+    '-maxmemory:memory use limit (kB)' \
+    '-exif=:file:_files' \
+    '-tracelevel:trace level' \
+    ':file:_pbm'
   ;;
+
 macptopbm)
-  _arguments '-extraskip:number of bytes to skip:' ':file: _pbm'
+  _arguments '-extraskip:number of bytes to skip' ':file:_pbm'
   ;;
 
 pbmclean)
@@ -80,15 +92,15 @@ pbmmake)
     '(-black -gray)-white[produce white pbm file]' \
     '(-white -gray)-black[produce black pbm file]' \
     '(-white -black)-gray[produce gray pbm file (stippled)]' \
-    ':width:' ':height:'
+    ':width' ':height'
   ;;
 
 pbmmask)
-  _arguments '-expand[expand mask by one pixel]' ':file: _pbm'
+  _arguments '-expand[expand mask by one pixel]' ':file:_pbm'
   ;;
 
 pbmpscale)
-  _arguments ':scale factor:' ':file: _pbm'
+  _arguments ':scale factor' ':file:_pbm'
   ;;
 
 pbmreduce)
@@ -96,119 +108,120 @@ pbmreduce)
     '(-fs -threshold)-floyd[use Floyd-Steinberg error diffusion]' \
     '(-floyd -threshold)-fs[use Floyd-Steinberg error diffusion]' \
     '(-floy -fs)-threshold[use simple thresholding]' \
-    '-value[specify thresholding value]:threshold value:' \
-    ':reduction factor:' ':file: _pbm'
+    '-value[specify thresholding value]:threshold value' \
+    ':reduction factor' ':file:_pbm'
   ;;
 
 pbmtext)
   _arguments \
     '(-builtin)-font[specify font file]:font file:_files -g \*.\(\#i\)pbm' \
     '(-font)-builtin[select builtin font]:builtin font:(bdf fixed)' \
-    '*:text:'
+    '-space[add space between characters]:space (pixels)' \
+    '*:text'
   ;;
 
 pbmto10x)
-  _arguments '-h[use resolution 120 x 144]' ':file: _pbm'
+  _arguments '-h[use resolution 120 x 144]' ':file:_pbm'
   ;;
 
 pbmtobg|pbmtobbnbg)
-  _arguments ':raster operation:' ':x position:' ':y position:'
+  _arguments ':raster operation' ':x position' ':y position'
   ;;
 
 pbmtoepsi)
-  _arguments '-bbonly[only create boundary box]' ':file: _pbm'
+  _arguments '-bbonly[only create boundary box]' ':file:_pbm'
   ;;
 
 pbmtolj)
   _arguments \
+    '-resolution[specify output device resolution]:resolution:(75 100 150 300 600)' \
     '-float[suppress positioning information]' \
-    '-norest[don'"'"'t write reset sequences]' \
-    '-resolution[specify output device resolution]:resolution:(75 100 150 300)' \
-    ':file: _pbm'
+    "-norest[don't write reset sequences]" \
+    '(-delta -compress)-packbits[enable use of TIFF packbits compression]' \
+    '(-packbits -compress)-delta[enable use of delta-between-rows compression]' \
+    '(-packbits -delta)-compress[enable both compression schemes]' \
+    ':file:_pbm'
   ;;
 
 pbmtoln03)
   _arguments \
-    '-l[specify left margin]:left margin:' \
-    '-r[specify right margin]:right margin:' \
-    '-t[specify top margin]:top margin:' \
-    '-b[specify bottom margin]:bottom margin:' \
-    '-f[specify form length]:form length:' ':file: _pbm'
+    '-l[specify left margin]:left margin' \
+    '-r[specify right margin]:right margin' \
+    '-t[specify top margin]:top margin' \
+    '-b[specify bottom margin]:bottom margin' \
+    '-f[specify form length]:form length' ':file:_pbm'
   ;;
 
 pbmtolps)
-  _arguments '-dpi[specify output resolution]:resolution:' ':file: _pbm'
+  _arguments '-dpi[specify output resolution]:resolution' ':file:_pbm'
   ;;
 
 pbmtomacp)
   _arguments \
-    '-l[specify left offset]:left offset:' \
-    '-r[specify right offset]:right offset:' \
-    '-t[specify top offset]:top offset:' \
-    '-b[specify bottom offset]:bottom offset:' \
-    ':file: _pbm'
+    '-l[specify left offset]:left offset' \
+    '-r[specify right offset]:right offset' \
+    '-t[specify top offset]:top offset' \
+    '-b[specify bottom offset]:bottom offset' \
+    ':file:_pbm'
   ;;
 
 pbmtopgm)
-  _arguments ':width:' ':height:' ':file: _pbm'
+  _arguments ':width' ':height' ':file:_pbm'
   ;;
 
 pbmtopk)
-  # This could be improved...
-  
   _arguments \
-    '-s[set design size]:design size:' \
-    '-C[set coding scheme]:coding scheme:' \
-    '-F[set font family comment]:font family:' \
+    '-s[set design size]:design size' \
+    '-C[set coding scheme]:coding scheme' \
+    '-F[set font family comment]:font family' \
     '-f[specify file with options]:option file:_files' \
-    '*-c[specify next character number]:character number:' \
-    '*-W[specify TFM width of next character]:width:' \
-    '*-H[specify TFM height of next character]:height:' \
-    '*-D[specify TFM depth of next character]:depth:' \
-    '*-I[specify italic correction of next character]:italic correction:' \
-    '*-h[specify horizontal escapement of next character]:horizontal escapement:' \
-    '*-v[specify vertical escapement of next character]:vertical escapement:' \
-    '*-x[specify x offset of next character]:x offset:' \
-    '*-y[specify y offset of next character]:y offset:' \
+    '*-c[specify next character number]:character number' \
+    '*-W[specify TFM width of next character]:width' \
+    '*-H[specify TFM height of next character]:height' \
+    '*-D[specify TFM depth of next character]:depth' \
+    '*-I[specify italic correction of next character]:italic correction' \
+    '*-h[specify horizontal escapement of next character]:horizontal escapement' \
+    '*-v[specify vertical escapement of next character]:vertical escapement' \
+    '*-x[specify x offset of next character]:x offset' \
+    '*-y[specify y offset of next character]:y offset' \
     ':pk file:_files -g \*.\(\#i\)pk' \
     ':tfm file:_files -g \*.\(\#i\)tfm' \
-    '*:file: _pbm'
+    '*:file:_pbm'
   ;;
 
 pbmupc)
-  _arguments -s{1,2} ':product type:' ':manufacturer code:' \
-             ':product code:'
+  _arguments -s{1,2} ':product type' ':manufacturer code' ':product code'
   ;;
 
 pgmcrater)
   _arguments \
-    '-number[specify number of craters]:number of craters:' \
-    '-gamma[specify gamma correction factor]:gamma factor:' \
-    '(-ysize)-height[specify picture height]:height:' \
-    '(-height)-ysize[specify picture height]:height:' \
-    '(-xsize)-width[specify picture width]:width:' \
-    '(-width)-xsize[specify picture width]:width:'
+    '-number[specify number of craters]:number of craters' \
+    '-gamma[specify gamma correction factor]:gamma factor' \
+    '(-ysize)-height[specify picture height]:height' \
+    '(-height)-ysize[specify picture height]:height' \
+    '(-xsize)-width[specify picture width]:width' \
+    '(-width)-xsize[specify picture width]:width'
   ;;
 
 pgmkernel)
-  _arguments '-weight:weight:' ':width:' ':height:'
+  _arguments '-weight:weight' ':width' ':height'
   ;;
 
 pgmnoise)
-  _arguments ':width:' ':height:'
+  _arguments ':width' ':height'
   ;;
 
 pgmnorm|ppmnorm)
   _arguments \
-    '(-bvalue)-bpercent[specify percentage to map to black]:black percentage:' \
-    '(-bpercent)-bvalue[specify pixel value to map to black]:black pixel value:' \
-    '(-wvalue)-wpercent[specify percentage to map to white]:white percentage:' \
-    '(-wpercent)-wvalue[specify pixel value to map to white]:white pixel value:' \
-    ':file: _pbm'
+    '(-bvalue)-bpercent[specify percentage to map to black]:black percentage' \
+    '(-bpercent)-bvalue[specify pixel value to map to black]:black pixel value' \
+    '(-wvalue)-wpercent[specify percentage to map to white]:white percentage' \
+    '(-wpercent)-wvalue[specify pixel value to map to white]:white pixel value' \
+    ':file:_pbm'
   ;;
 
 pgmoil)
-  _arguments '-n[specify smear size]:smear size:' ':file: _pbm'
+  _arguments '-n[specify smear size]:smear size' ':file:_pbm'
   ;;
 
 pgmramp)
@@ -217,11 +230,11 @@ pgmramp)
     '(-lr -rectangle -ellipse)-tb[produce top to bottom ramp]' \
     '(-lr -tb -ellipse)-rectangle[produce rectangular ramp]' \
     '(-lr -tb -rectangle)-ellipse[produce elliptical ramp]' \
-    ':width:' ':height:'
+    ':width' ':height'
   ;;
 
 pgmtexture)
-  _arguments '-d[specify distance]:distance:' ':file: _pbm'
+  _arguments '-d[specify distance]:distance' ':file:_pbm'
   ;;
 
 pgmtopbm)
@@ -238,9 +251,9 @@ pgmtopbm)
     '(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -cluster8 -c8 -value -clump)-c4[use 45 degree clustered dither]' \
     '(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -c8 -value -clump)-cluster8[use 45 degree clustered dither]' \
     '(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -value -clump)-c8[use 45 degree clustered dither]' \
-    '-value[specify thresholding value]:threshold value:' \
-    '-clump[specify number of pixels per clump]:number of pixel:' \
-':file: _pbm'
+    '-value[specify thresholding value]:threshold value' \
+    '-clump[specify number of pixels per clump]:number of pixel' \
+    ':file:_pbm'
   ;;
 
 pgmtoppm)
@@ -250,9 +263,9 @@ pgmtoppm)
       return
     fi
     _x_color && ret=0
-  
+
     _wanted options expl option compadd - -map && ret=0
-  
+
     return ret
   elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then
     _description files expl 'map file'
@@ -264,11 +277,19 @@ pgmtoppm)
 
 pktopbm)
   _arguments \
-    '*-x[set width of next bitmap]:width:' \
-    '*-y[set height of next bitmap]:height:' \
-    '*-c[set next character number]:character number:' \
+    '*-x[set width of next bitmap]:width' \
+    '*-y[set height of next bitmap]:height' \
+    '*-c[set next character number]:character number' \
     ':pk file:_files -g \*.\(\#i\)pk' \
-    '*:file: _pbm'
+    '*:file:_pbm'
+  ;;
+
+pngtopnm)
+  _arguments \
+    -{verbose,alpha,mix,time} \
+    '-background:color:_x_color' \
+    '-gamma:value' '-text:file:_files' \
+    ':file:_pbm'
   ;;
 
 pnmalias)
@@ -279,14 +300,14 @@ pnmalias)
     '(-fonly)-bonly[apply antialias only to background pixels]' \
     '(-balias)-falias[apply antialias to all pixels around foreground pixels]' \
     '(-falias)-balias[apply antialias to all pixels around foreground pixels]' \
-    '-weight[set central aliasing weight]:central aliasing weight:' \
-    ':file: _pbm'
+    '-weight[set central aliasing weight]:central aliasing weight' \
+    ':file:_pbm'
   ;;
 
 pnmarith)
   _arguments \
-    -{add,subtract,multiply,difference,minimum,maximum} \
-    '*:file: _pbm'
+    '(-)'-{add,subtract,multiply,difference,minimum,maximum} \
+    '*:file:_pbm'
   ;;
 
 pnmcat)
@@ -301,60 +322,62 @@ pnmcat)
     '(-topbottom -tb -jtop -jleft -jright)-jbottom[align pictures at bottom]' \
     '(-leftright -lr -jright -jtop -jbottom)-jleft[align pictures at left side]' \
     '(-leftright -lr -jleft -jtop -jbottom)-jright[align pictures at right side]' \
-    '*:file: _pbm'
+    '*:file:_pbm'
   ;;
 
 pnmcomp)
   _arguments \
     '-invert[invert overlay pixel values]' \
-    '-xoff[specify overlay x offset]:x offset:' \
-    '-yoff[specify overlay y offset]:y offset:' \
+    '(-align)-xoff[specify overlay x offset]:x offset' \
+    '(-valign)-yoff[specify overlay y offset]:y offset' \
+    '(-xoff)-align=[specify horizontal alignment for overlay image]:alignment:(left center right)' \
+    '(-yoff)-valign=[specify vertical alignment for overlay image]:alignment:(top middle bottom)' \
     '-alpha[specify alpha mask file]:alpha mask file:_files -g \*.\(\#i\)pgm' \
-    ':overlay file:_pbm' '*:file: _pbm'
+    ':overlay file:_pbm' '*:file:_pbm'
   ;;
 
 pnmconvol)
-  _arguments ':convolution file:_pbm' ':file: _pbm'
+  _arguments ':convolution file:_pbm' ':file:_pbm'
   ;;
 
 pnmcrop)
   _arguments \
     '(-black)-white' \
     '(-white)-black' \
+    -sides \
     -{left,right,top,bottom} \
-    ':file: _pbm'
+    -verbose \
+    ':file:_pbm'
   ;;
 
 pnmcut)
-  _arguments ':x position:' ':y position:' ':width:' ':height:' ':file: _pbm'
+  _arguments \
+    '-left:left col' '-right:right col' '-top:top col' '-bottom:bottom col' \
+    '-width:width' '-height:height' -pad -verbose \
+    ':x position' ':y position' ':width' ':height' ':file:_pbm'
   ;;
 
 pnmdepth)
-  _arguments ':new maximum value:' ':file: _pbm'
+  _arguments ':new maximum value' ':file:_pbm'
   ;;
 
 pnmenlarge)
-  _arguments ':enlargement factor:' ':file: _pbm'
+  _arguments ':enlargement factor' ':file:_pbm'
   ;;
 
 pnmflip)
-  _arguments \*-{leftright,lr,topbottom,tb,transpose,xy,rotate90,r90,ccw,rotate270,r270,cw} \
-             ':file: _pbm'
+  _arguments \
+    \*-{leftright,lr,topbottom,tb,transpose,xy,rotate90,r90,ccw,rotate270,r270,cw,rotate180,r180} \
+    ':file:_pbm'
   ;;
 
 pnmgamma)
-  if [[ CURRENT -eq 2 ]]; then
-    _message -e gamma-values 'gamma value or red gamma value'
-  elif [[ CURRENT -eq 3 ]]; then
-    _pbm && ret=0
-    _message -e gamma-values 'green gamma value'
-  elif [[ CURRENT -eq 4 ]]; then
-    _message -e gamma-values 'blue gamma value'
-  elif [[ CURRENT -eq 5 ]]; then
-    _pbm && ret=0
-  fi
-  
-  return ret
+  _arguments \
+    -ungamma -cieramp \
+    '1:gamma value or red gamma value' \
+    '2: :{ _message -e gamma-values "green gamma value";_pbm }' \
+    '3:blue gamma value' \
+    '4:file:_pbm'
   ;;
 
 pnmhisteq)
@@ -363,97 +386,126 @@ pnmhisteq)
     '-gray[modify only gray pixels]' \
     '-rmap[specify input luminosity map file]:luminosity map file:_files -g \*.\(\#i\)pgm' \
     '-wmap[specify output luminosity map file]:luminosity map file:_files -g \*.\(\#i\)pgm' \
-    ':file: _pbm'
+    ':file:_pbm'
   ;;
 pnmhistmap)
-  _arguments -{black,white,verbose} '-max:maximum value:' ':file: _pbm'
+  _arguments -{black,white,verbose} '-max:maximum value' ':file:_pbm'
   ;;
 
 pnmindex)
   _arguments \
-    '-size[set size of index pictures]:image size:' \
-    '-across[specify number of pictures per ros]:images per row:' \
-    '-colors[specify maximum number of colors]:number of colors:' \
+    '-size[set size of index pictures]:image size' \
+    '-across[specify number of pictures per ros]:images per row' \
+    '-colors[specify maximum number of colors]:number of colors' \
     '-black[use black padding]' \
-    '*:file: _pbm'
+    '-title[specify a title to place at the top of the image]:title' \
+    '(-noquant)-quant[enable quantization]' \
+    '(-quant)-noquant[disable quantization]' \
+    '*:file:_pbm'
   ;;
 
 pnmmargin)
   _arguments \
     '(-black -colors)-white' \
     '(-white -colors)-black' \
-    '(-white -black)-color:color: _x_color' \
-    ':border width:' \
-    ':file: _pbm'
+    '(-white -black)-color:color:_x_color' \
+    ':border width' \
+    ':file:_pbm'
   ;;
 
 pnmnlfilt)
-  _arguments ':alpha value:' ':radius:' ':file: _pbm'
+  _arguments ':alpha value' ':radius' ':file:_pbm'
   ;;
 
 pnmpad)
   _arguments \
     '(-white)-black[add black border]' \
     '(-black)-white[add white border]' \
-    '-l-[specify left border width]:left border width:' \
-    '-r-[specify right border width]:right border width:' \
-    '-t-[specify top border width]:top border width:' \
+    '-l-[specify left border width]:left border width' \
+    '-r-[specify right border width]:right border width' \
+    '-t-[specify top border width]:top border width' \
     '-b-[specify bottom border width]: :_guard "[0-9]#" "bottom border width"' \
-    ':file: _pbm'
+    ':file:_pbm'
   ;;
 
 pnmpaste)
   _arguments \
-    '(-or -and -xor)-replace' \
-    '(-replace -and -xor)-or' \
-    '(-replace -or -xor)-and' \
-    '(-replace -or -and)-xor' \
-     ':"from" picture file:_pbm' \
-    :{x,y}' position:' \
+    '(-)'{-replace,-or,-and,-xor} \
+    ':"from" picture file:_pbm' \
+    :{x,y}' position' \
     ':"into" picture file:_pbm'
   ;;
 
 pnmrotate)
-  _arguments '-noantialias' ':rotation angle:' ':file: _pbm'
+  _arguments '-noantialias' ':rotation angle' ':file:_pbm'
   ;;
 
 pnmscale)
-  local scale
-  
-  if [[ "$words[2]" = -* ]]; then
-    scale=()
-  else
-    scale=( ':scale factor:' )
-  fi
-  
+  local -a scale
+
+  [[ "$words[2]" = -* ]] || scale=( ':scale factor' )
+
   _arguments \
-    '(-width)-xsize:width:' \
-    '(-xsize)-width:width:' \
-    '(-height)-ysize:height:' \
-    '(-ysize)-height:height:' \
-    '-xscale:horizontal scale factor:' \
-    '-yscale:vertical scale factor:' \
-    '(-width -xsize -height -ysize -xscale -yscale -pixels)-xysize:width::height:' \
-    '(-width -xsize -height -ysize -xscale -yscale -xysize)-pixels:total number of pixels:' \
-    "$scale[@]" \
-    ':file: _pbm'
+    '(-)-reduce:reduction factor' \
+    '(-reduce -xysize -pixels -width -xscale)-xsize:width' \
+    '(-reduce -xysize -pixels -xsize -xscale)-width:width' \
+    '(-reduce -xysize -pixels -height -yscale)-ysize:height' \
+    '(-reduce -xysize -pixels -ysize -yscale)-height:height' \
+    '(-reduce -xysize -pixels -width -xsize)-xscale:horizontal scale factor' \
+    '(-reduce -xysize -pixels -height -ysize)-yscale:vertical scale factor' \
+    '(-width -xsize -height -ysize -xscale -yscale -pixels)-xysize:width::height' \
+    '(-width -xsize -height -ysize -xscale -yscale -xysize)-pixels:total number of pixels' \
+    '-verbose' "$scale[@]" \
+    ':file:_pbm'
   ;;
 
 pnmshear)
-  _arguments '-noantialias' ':shearing angle:' ':file: _pbm'
+  _arguments '-noantialias' ':shearing angle' ':file:_pbm'
   ;;
 
 pnmtile)
-  _arguments ':width:' ':height:' ':file: _pbm'
+  _arguments ':width' ':height' ':file:_pbm'
   ;;
 
 pnmtoddif)
-  _arguments '-resolution:horizontal resolution::vertical resolution:' \
-             ':file: _pbm' ':ddif file:_files -g \*.\(\#i\)ddif'
+  _arguments \
+    '-resolution:horizontal resolution::vertical resolution' \
+    ':file:_pbm' ':ddif file:_files -g \*.\(\#i\)ddif'
   ;;
 
 pnmtofits)
-  _arguments '-max:maximum value:' '-min:minimum value:' ':file: _pbm'
+  _arguments '-max:maximum value' '-min:minimum value' ':file:_pbm'
+  ;;
+
+pnmtojpeg)
+  _arguments \
+    '--exif=:file:_files' \
+    '--quality=:quality' \
+    --{grayscale,greyscale,optimize,progressive,verbose,baseline} \
+    '--comment=:comment' \
+    '--dct=:dct method:(int fast float)' \
+    '--restart=:rows' \
+    '--smooth=:strength' \
+    '--maxmemory=:memory use limit (kB)' \
+    '--qtables=:file:_files' \
+    '--qslots=:table' \
+    '--sample=:sampling factor' \
+    '--scans:file:_files' \
+    ':file:_pbm'
+  ;;
+
+pnmtopng)
+  _arguments \
+    -{verbose,downscale,interlace,hist,force} \
+    '-alpha:file:_files' '-gamma:value' \
+    '-transparent::color:_x_color' '-background:color:_x_color' \
+    '-chroma:wx::wy::rx::ry::gx::gy::bx::by' \
+    '-phys:x::y::unit' \
+    '-text:file:_files' '-ztxt:file:_files' \
+    '-time:date ([yy]yy-mm-dd)::time (hh:mm:ss)' \
+    '-filter:type:((0\:none 1\:sub 2\:up 3\:avg 4\:paeth))' \
+    '-compression:level:(0 1 2 3 4 5 6 7 8 9)' \
+    ':file:_pbm'
   ;;
 
 pnmtops)
@@ -461,20 +513,24 @@ pnmtops)
     '(-noturn)-turn' '(-turn)-noturn' \
     '(-nocenter)-center '(-center)-nocenter \
     '(-rle)-runlength' '(-runlength)-rle' \
-    '-scale:scale factor:' \
-    '-dpi:output resolution:' \
-    '-width:page width:' '-height:page height' ':file: _pbm'
+    '(-imagewidth -imageheight)-scale:scale factor' \
+    '-dpi:output resolution' \
+    '(-scale -equalpixels)-imagewidth:width on page (inches)' \
+    '(-scale -equalpixels)-imageheight:height on page (inches)' \
+    '-width:page width' '-height:page height' \
+    '(-imagewidth -imageheight)-equalpixels' \
+    ':file:_pbm'
   ;;
 
 pnmtorast)
-  _arguments '(-rle)-standard' '(-standard)-rle' ':file: _pbm'
+  _arguments '(-rle)-standard' '(-standard)-rle' ':file:_pbm'
   ;;
 
 pnmtosgi)
   _arguments \
     '(-rle)-verbatim' '(-verbatim)-rle' \
-    '-imagename:image name:' \
-    ':file: _pbm'
+    '-imagename:image name' \
+    ':file:_pbm'
   ;;
 
 pnmtotiff)
@@ -485,107 +541,118 @@ pnmtotiff)
     '(-none -packbits -lzw -g4 -predictor)-g3' \
     '(-none -packbits -lzw -g3 -2d -fill -predictor)-g4' \
     '-2d' \
-    '-fill' \
+    '-fill' '-minisblack' \
     '(-lsb2msb)-msb2lsb' \
     '(-msb2lsb)-lsb2msb' \
     '-predictor:LZW predictor:((1\:without\ differencing 2\:with\ differencing))' \
-    '-rowsperstrip:number of rows per strip:' ':file: _pbm'
+    '-rowsperstrip:number of rows per strip' ':file:_pbm'
   ;;
 
 pnmtoxwd)
-  _arguments '-pseudodepth:depth of PseudoColor dumps:' '-directcolor' \
-             ':file: _pbm'
+  _arguments \
+    '-pseudodepth:depth of PseudoColor dumps' '-directcolor' \
+    ':file:_pbm'
   ;;
 
 ppm3d)
-  _arguments :{left,right}' picture file:_pbm' ':horizontal offset:'
+  _arguments :{left,right}' picture file:_pbm' ':horizontal offset'
   ;;
 
 ppmbrighten)
   _arguments \
     '-n[normalize value]' \
-    '-s[specify saturation difference]:saturation difference:' \
-    '-v[specify value difference]:value difference:' \
-    ':file: _pbm'
+    '-s[specify saturation difference]:saturation difference' \
+    '-v[specify value difference]:value difference' \
+    ':file:_pbm'
   ;;
 
 ppmchange)
-  _pbm && ret=0
-  
-  if (( CURRENT & 1 )); then
-    _description colors expl 'new color'
-  else
-    _description colors expl 'old color'
+  local curcontext="$curcontext" state line
+
+  _arguments -C \
+    "-closeness[specify how close a pixel's color should be]:closeness (percent)" \
+    '-remainder[specify replacement for colours not given explicit replacement]:color:_x_color' \
+    '*: :->args' && ret=0
+
+  if [[ -n "$state" ]]; then
+    if (( CURRENT & 1 )); then
+      _wanted colors expl 'new color' _x_color && ret=0
+    else
+      _alternative \
+	'files:file:_pbm' \
+	'colors:old color:_x_color' && ret=0
+    fi
   fi
-  
-  _x_color "$expl[@]" && ret=0
-  
+
   return ret
   ;;
 
 ppmdim)
-  _arguments ':diminishing factor:' ':file: _pbm'
+  _arguments ':diminishing factor' ':file:_pbm'
   ;;
 
 ppmdist)
   _arguments \
     '(-frequency)-intensity[sort colors by grayscale intensity]' \
     '(-intensity)-frequency[sort colors by frequency]' \
-    ':file: _pbm'
+    ':file:_pbm'
   ;;
 
 ppmdither)
-  _arguments '-dim:matrix size:' \
-             '-red:number of red shades:' \
-             '-green:number of green shades:' \
-             '-blue:number of blue shades:' \
-             ':file: _pbm'
+  _arguments \
+    '-dim:matrix size' \
+    '-red:number of red shades' \
+    '-green:number of green shades' \
+    '-blue:number of blue shades' \
+    ':file:_pbm'
   ;;
 
 ppmflash)
-  _arguments ':flash factor:' ':file: _pbm'
+  _arguments ':flash factor' ':file:_pbm'
   ;;
 
 ppmforge)
-  _arguments -{clouds,night} \
-             '-dimension:fractal dimension:' '-hour:hour angle:' \
-             '(-tilt)-inclination:inclination angle:' \
-             '(-inclination)-tilt:inclination angle:' \
-             '-mesh:FFT mesh size:' '-power:elevations power factor:' \
-             '-glaciers:glacier elevation:' '-ice:polar ice cap extent:' \
-             '-saturation:star color saturation:' \
-             '-seed:random number seed:' \
-             '-stars:minimum star pixel percentage:' \
- 	     '(-xsize)-width:width:'   '(-width)-xsize:width:' \
- 	     '(-ysize)-height:height:' '(-height)-ysize:height:'
+  _arguments \
+    -{clouds,night} \
+    '-dimension:fractal dimension' '-hour:hour angle' \
+    '(-tilt)-inclination:inclination angle' \
+    '(-inclination)-tilt:inclination angle' \
+    '-mesh:FFT mesh size' '-power:elevations power factor' \
+    '-glaciers:glacier elevation' '-ice:polar ice cap extent' \
+    '-saturation:star color saturation' \
+    '-seed:random number seed' \
+    '-stars:minimum star pixel percentage' \
+    '(-xsize)-width:width'   '(-width)-xsize:width' \
+    '(-ysize)-height:height' '(-height)-ysize:height'
   ;;
 
 ppmmake)
-  _arguments ':color: _x_color' ':width:' ':height:'
+  _arguments ':color:_x_color' ':width' ':height'
   ;;
 
 ppmmix)
-  _arguments ':fade factor:' ':file: _pbm' ':file: _pbm'
+  _arguments ':fade factor' ':file:_pbm' ':file:_pbm'
   ;;
 
 ppmntsc)
-  _arguments ':dim factor:' ':file: _pbm'
+  _arguments ':dim factor' ':file:_pbm'
   ;;
 
 ppmpat)
-  _arguments '(gingham2 -gingham3 -g2 -g3 -madras -tartan -poles -squig -camo -anticamo)'-{gingham{2,3},g{2,3},madras,tartan,poles,squig,camo,anticamo} \
-             ':width:' ':height:'
+  _arguments \
+    '(-)'-{gingham{2,3},g{2,3},madras,tartan,poles,squig,camo,anticamo} \
+    ':width' ':height'
   ;;
 
 ppmquant)
   local opt=yes
-  
+
   if [[ "$words[2]" = -(fs|floyd) ]]; then
     (( CURRENT-- ))
     shift 1 words
     opt=''
   fi
-  
+
   if [[ CURRENT -eq 2 ]]; then
     if [[ -n "$opt" ]]; then
       _wanted options expl option compadd - -map -fs -floyd && ret=0
@@ -593,7 +660,7 @@ ppmquant)
       _wanted options expl option compadd - -map && ret=0
     fi
     _message -e numbers 'number of colors'
-  
+
     return ret
   elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then
     _description files expl 'map file'
@@ -604,15 +671,17 @@ ppmquant)
   ;;
 
 ppmquantall)
-  _arguments ':number of colors:' '*:file: _pbm'
+  _arguments \
+    '-ext:extension' ': :_guard "[0-9]#" "number of colors"' \
+    '*:file:_pbm'
   ;;
 
 ppmshift)
-  _arguments ':shift value:' ':file: _pbm'
+  _arguments ':shift value' ':file:_pbm'
   ;;
 
 ppmspread)
-  _arguments ':maximum spread amount:' ':file: _pbm'
+  _arguments ':maximum spread amount' ':file:_pbm'
   ;;
 
 ppmtoacad)
@@ -621,80 +690,115 @@ ppmtoacad)
     '(-dxb)-poly[render pixels as filled polygons]' \
     '-8[restrict colors to the 8 RGB shades]' \
     '(-background)-white[use white background]' \
-    '(-white)-background:background color (0-255):' \
-    '-aspect:pixel aspect ratio:' \
-    ':file: _pbm'
+    '(-white)-background:background color (0-255)' \
+    '-aspect:pixel aspect ratio' \
+    ':file:_pbm'
   ;;
 
 ppmtobmp)
-  _arguments '(-windows)-os2' '(-os2)-windows' ':file: _pbm'
+  _arguments \
+    '(-windows)-os2' '(-os2)-windows' \
+    '-bpp[secify bits per pixel for BMP file]:bits per pixel:(1 4 8 24)' \
+    ':file:_pbm'
   ;;
 
 ppmtogif)
-  _arguments '-interlace' ':file: _pbm'
+  _arguments \
+    '-interlace[produce interlaced GIF]' \
+    '-sort[produce GIF with sorted color map]' \
+    '-map[use colors in specified file]:map file:_files' \
+    '(-alpha)-transparent[specify transparent color]:color' \
+    '(-transparent)-alpha[specify PGM file containing alpha mask]:file:_pbm' \
+    '-comment[include a comment in the GIF file]:comment text' \
+    '-nolxw[skip LZW compression]' \
+    ':file:_pbm'
   ;;
 
 ppmtoicr)
-  _arguments '-windowname:window name:' '-expand:expansion factor:' \
-             '-display:display screen:' '-rle' ':file: _pbm'
+  _arguments \
+    '-windowname:window name' '-expand:expansion factor' \
+    '-display:display screen' '-rle' ':file:_pbm'
   ;;
 
 ppmtoilbm)
-  _arguments '-hamif' ':file: _pbm'
+  _arguments \
+    '(-mp -maxplanes)'{-mp,-maxplanes}':planes' \
+    '(-fp -fixplanes)'{-fp,-fixplanes}':planes' \
+    '(-hambits -hamplanes)'{-hambits,-hamplanes}':planes' \
+    -normal -hamif -24if -dcif -hamforce -24force -dcforce \
+    '(-dcbits -dcplanes)'{-dcbits,-dcplanes}':bits for red: :bits for green: :bits for blue' \
+    -ecs -aga -ham6 -ham8 -compress '-cmethod:method:(none byterun1)' \
+    '-map:ppm file:_pbm' -cmaponly -savemem \
+    ':file:_pbm'
   ;;
 
 ppmtomap)
-  _arguments -s{ort,quare} ':file: _pbm'
+  _arguments -s{ort,quare} ':file:_pbm'
   ;;
 
 ppmtomitsu)
-  _arguments '-sharpness:sharpness:(1 2 3 4)' \
-             '-enlarge:enlargement factor:(1 2 3)' \
-             '-media:output media (default\: 1184x1350):((A\:1216x1350 A4\:1184x1452 AS\:1216x1650 A4S\:1184x1754))' \
-             '-copy:number of copies:(1 2 3 4 5 6 7 8 9)' \
-             -{dpi300,tiny} ':file: _pbm'
+  _arguments \
+    '-sharpness:sharpness:(1 2 3 4)' \
+    '-enlarge:enlargement factor:(1 2 3)' \
+    '-media:output media (default\: 1184x1350):((A\:1216x1350 A4\:1184x1452 AS\:1216x1650 A4S\:1184x1754))' \
+    '-copy:number of copies:(1 2 3 4 5 6 7 8 9)' \
+    -{dpi300,tiny} ':file:_pbm'
+  ;;
+
+ppmtopcx)
+  _arguments -{24bit,packed} ':file:_pbm'
   ;;
 
 ppmtopj)
-  _arguments '-gamma:gamma value:' '-xpos:x position:' -{rle,center} \
-             '-ypos:y position:' '-back:background brightness:(dark lite)' \
-             '-render:rendering algorithm:(none snap bw dither diffuse monodither monodiffuse clusterdither monoclusterdither)' \
-             ':file: _pbm'
+  _arguments \
+    '-gamma:gamma value' '-xpos:x position' -{rle,center} \
+    '-ypos:y position' '-back:background brightness:(dark lite)' \
+    '-render:rendering algorithm:(none snap bw dither diffuse monodither monodiffuse clusterdither monoclusterdither)' \
+    ':file:_pbm'
   ;;
 
 ppmtopjxl)
   _arguments \
     -{nopack,presentation,dark,diffuse,cluster,dither} \
-    '-gamma:gamma value:' \
-    '-xshift:x shift:' '-yshift:y shift:' \
-    '(-width -xscale)-xscale:width:' \
-    '(-xsize -xscale)-width:width:' \
-    '(-xsize -width)-xscale:horizontal scale factor:' \
-    '(-height -yscale)-ysize:height:' \
-    '(-ysize -yscale)-height:height:' \
-    '(-ysize -height)-yscale:vertical scale factor:' \
-    ':file: _pbm'
+    '-gamma:gamma value' \
+    '-xshift:x shift' '-yshift:y shift' \
+    '(-width -xscale)-xscale:width' \
+    '(-xsize -xscale)-width:width' \
+    '(-xsize -width)-xscale:horizontal scale factor' \
+    '(-height -yscale)-ysize:height' \
+    '(-ysize -yscale)-height:height' \
+    '(-ysize -height)-yscale:vertical scale factor' \
+    ':file:_pbm'
   ;;
 
 ppmtosixel)
-  _arguments -{raw,margin} ':file: _pbm'
+  _arguments -{raw,margin} ':file:_pbm'
   ;;
 
 ppmtotga)
-  _arguments -{mono,cmap,rgb,norle} ':file: _pbm'
+  _arguments -{mono,cmap,rgb,norle} ':file:_pbm'
+  ;;
+
+ppmtouil)
+  _arguments '-name:name prefix' ':file:_pbm'
   ;;
 
-ppmtouil|ppmtoxpm)
-  _arguments '-name:name prefix:' ':file: _pbm'
+ppmtorle)
+  _arguments \
+    '-name=:name prefix' \
+    '-rgb=:X11 rgb file:_files' \
+    '-alphamask=:pgm file:_pbm' \
+    ':file:_pbm'
   ;;
 
 ppmtoyuvsplit)
-  _arguments ':base name:' ':file: _pbm'
+  _arguments ':base name' ':file:_pbm'
   ;;
 
 psidtopgm)
-  _arguments ':width:' ':height:' ':bits per sample:' \
-             ':postscript file:_files -g \*.\(\#i\)\(ps\|eps\)'
+  _arguments \
+    ':width' ':height' ':bits per sample' \
+    ':postscript file:_files -g "*.(#i)(ps|eps)"'
   ;;
 pstopnm)
   _arguments \
@@ -704,28 +808,33 @@ pstopnm)
     '(-pbm -ppm)-pgm' \
     '(-pbm -pgm)-ppm' \
     -{forceplain,help,nocrop,verbose} \
-    '-llx:loxer left x position:' '-lly:lower left y position:' \
-    '-urx:upper right x position:' '-ury:upper right y position:' \
-    '-xborder:x border fraction:' '-yborder:y border fraction:' \
-    '-xmax:maximum width:' '-ymax:maximum height' \
-    '-xsize:width:' '-ysize:height:' \
+    '-llx:loxer left x position' '-lly:lower left y position' \
+    '-urx:upper right x position' '-ury:upper right y position' \
+    '-xborder:x border fraction' '-yborder:y border fraction' \
+    '-xmax:maximum width' '-ymax:maximum height' \
+    '-xsize:width' '-ysize:height' \
     ':postscript file:_files -g \*.\(\#i\)\(ps\|eps\)'
   ;;
 
 rawtopgm)
-  _arguments '-headerskip:header bytes to skip:' \
-             '-rowskip:row padding to skip:' \
-             ':width:' ':height:' ':grayscale bytes:'
+  _arguments \
+    '-maxval:value' \
+    '-bpp:bytes:(1 2)' \
+    -littleendian \
+    '(-bt -bottomfirst -rowskip)-'{bt,bottomfirst} \
+    '-headerskip:header bytes to skip' \
+    '(-bt -bottomfirst)-rowskip:row padding to skip' \
+    ': :_guard "[0-9]#" width' ':height' ':grayscale bytes'
   ;;
 
 rawtoppm)
   _arguments \
-    '-headerskip:header bytes to skip:' \
-    '-rowskip:row padding to skip:' \
+    '-headerskip:header bytes to skip' \
+    '-rowskip:row padding to skip' \
     '(-rgb -rbg -grb -gbr -brg -bgr)'-{rgb,rbg,grb,gbr,brg,bgr} \
     '(-interrow)-interpixel' \
     '(-interpixel)-interrow' \
-    ':width:' ':height:' ':grayscale bytes:'
+    ': :_guard "[0-9]#" width' ':height' ':grayscale bytes'
   ;;
 
 rgb3toppm)
@@ -736,36 +845,44 @@ rgb3toppm)
   elif [[ CURRENT -eq 4 ]]; then
     expl='blue picture file'
   fi
-  
+
   if [[ -n "$expl" ]]; then
     _description files expl "$expl"
     _files "$expl" -g '*.(#i)pgm'
   fi
   ;;
 
+rletopnm)
+  _arguments \
+    '--alphaout=:alpha file:_pbm' \
+    -{h,-headerdump,v,-verbose,p,-plain} \
+    ':file:_pbm'
+  ;;
+
 sgitopnm)
-  _arguments '-verbose' ':file: _pbm'
+  _arguments '-verbose' '-channel:channel' ':file:_pbm'
   ;;
 
 sldtoppm)
-  _arguments -{adjust,dir,info,verbose} \
-             '(-width -xsize)'-{width,xsize}:width: \
-             '(-height -ysize)'-{height,ysize}:height: \
-             '-scale:scale factor:' \
-             '(-lib -Lib)'-{l,L}'ib:slide name:' \
-             ':file: _pbm'
+  _arguments \
+    -{adjust,dir,info,verbose} \
+    '(-width -xsize)'-{width,xsize}:width \
+    '(-height -ysize)'-{height,ysize}:height \
+    '-scale:scale factor' \
+    '(-lib -Lib)'-{l,L}'ib:slide name' \
+    ':file:_pbm'
   ;;
 
 yuvsplittoppm)
-  _arguments ':base name:' ':width:' ':height:' '-ccir601'
+  _arguments ':base name' ':width' ':height' '-ccir601'
   ;;
 
 yuvtoppm)
-  _arguments ':width:' ':height:' ':image bytes:'
+  _arguments ':width' ':height' ':image bytes'
   ;;
 
 zeisstopnm)
-  _arguments '(-pgm -ppm)'-p{g,p}m ':file: _pbm'
+  _arguments '(-pgm -ppm)'-p{g,p}m ':file:_pbm'
   ;;
 
 *)
diff --git a/Completion/Unix/Command/_rar b/Completion/Unix/Command/_rar
index 73b8db3d4..910989437 100644
--- a/Completion/Unix/Command/_rar
+++ b/Completion/Unix/Command/_rar
@@ -1,137 +1,88 @@
 #compdef rar unrar
 
+local common
 
-_rar(){
-    case $service in
-        rar)
-        _arguments -s \
-        '*::rar command:_rar_command' 
-        ;;
-    unrar)
-        _arguments -s \
-        '*::unrar command:_unrar_command'
-        ;;
-    esac
-}
+common=(
+  '-ad[append archive name to destination path]'
+  '-ap[set path inside archive]'
+  '-av\-[disable authenticity verification check]'
+  '-c\-[disable comments show]'
+  '-cfg\-[disable read configuration]'
+  '-cl\-[convert names to lower case]'
+  '-cu[convert names to upper case]'
+  '-dh[open shared files]'
+  '-ep[exclude paths from name]'
+  '-f[freshen files]'
+  '-idp[disable percentage display]'
+  '-ierr[send all messages to stderr]'
+  '-inul[disable all messages]'
+  '-kb[keep broken extracted files]'
+  '-o\+[overwrite existing files]'
+  '-o\-[do not overwrite existing files]'
+  '-ow[save or restore file owner and group]'
+  '-p\-[do not query password]'
+  '-r[recurse subdirectorie]'
+  '-ta[process files modified after <date> in YYYYMMDDHHMMSS format]'
+  '-tb[process files modified before <date> in YYYYMMDDHHMMSS format]'
+  '-tn[process files newer than <time>]'
+  '-to[process files older than <time>]'
+  '-u[update files]'
+  '-v[create volumes with size autodetection or list all volumes]'
+  '-ver[file version control]'
+  '-vp[pause before each volume]'
+  '-x[exclude specified file]'
+  '-y[assume yes answer to all queries]'
+)
 
-_compression_level() {
-    compression_level=
-    _tags compression_level && { compadd "$@" -k compression_level || compadd "$@" ${(kv)=compression_level} }
-}
-
-_dico_size() {
-    dico_size=(64 128 256 512 1024 2048 4096 a b c d e f g)
-    _tags dico_size && { compadd "$@" -k dico_size || compadd "$@" ${(kv)=dico_size} }
-}
-
-_unrar_command () {
-    cmd=(e l lt p t v vt x)
-    if (( CURRENT == 1 ));then
-        _tags cmd && { compadd "$@" -k cmd || compadd "$@" ${(kv)=cmd} }
+case $service in
+  unrar)
+    if (( CURRENT == 2 )); then
+      _wanted commands expl 'rar command' compadd e l lt p t v vt x && return
     else
-        _arguments -C  \
-            '-ad[Append archive name to destination path]'\
-            '-ap[Set path inside archive]'\
-            '-av\-[Disable authenticity verification check]'\
-            '-c\-[Disable comments show]'\
-            '-cfg\-[Disable read configuration]'\
-            '-cl\-[Convert names to lower case]'\
-            '-cu[Convert names to upper case]'\
-            '-dh[Open shared files]'\
-            '-ep[Exclude paths from name]'\
-            '-f[Freshen files]'\
-            '-idp[Disable percentage display]'\
-            '-ierr[Send all messages to stderr]'\
-            '-inul[Disable all messages]'\
-            '-kb[Keep broken extracted files]'\
-            '-o\+[Overwrite existing files]'\
-            '-o\-[Do not overwrite existing files]'\
-            '-ow[Save or restore file owner and group]'\
-            '-p\-[Do not query password]'\
-            '-r[Recurse subdirectorie]'\
-            '-ta[Process files modified after <date> in YYYYMMDDHHMMSS format]'\
-            '-tb[Process files modified before <date> in YYYYMMDDHHMMSS format]'\
-            '-tn[Process files newer than <time>]'\
-            '-to[Process files older than <time>]'\
-            '-u[Update files]'\
-            '-v[Create volumes with size autodetection or list all volumes]'\
-            '-ver[File version control]'\
-            '-vp[Pause before each volume]'\
-            '-x[Exclude specified file]'\
-            '-y[Assume Yes on all queries]'\
-            '*:RAR files:_files -g \*.rar' && return 0
+      _arguments "$common[@]" '*:RAR files:_files -g \*.rar' && return
     fi
-}
-
-_rar_command () {
-    cmd=(a c cf cw d e f i k l lt m mf p r rc rr rv s t u v vt x)
-    if (( CURRENT == 1 ));then
-        _tags cmd && { compadd "$@" -k cmd || compadd "$@" ${(kv)=cmd} }
+  ;;
+  rar)
+    if (( CURRENT == 2 )); then
+      _wanted commands expl 'rar command' compadd \
+	  a c cf cw d e f i k l lt m mf p r rc rr rv s t u v vt x && return
     else
-        _arguments -s \
-            '-ad[Append archive name to destination path]'\
-            '-ag[Generate archive name using the current date]'\
-            '-ap[Set path inside archive]'\
-            '-as[Synchronize archive contents]'\
-            '-av[Put authenticity verification (registered versions only)]'\
-            '-av\-[Disable authenticity verification check]'\
-            '-c\-[Disable comments show]'\
-            '-cfg\-[Disable read configuration]'\
-            '-cl\-[Convert names to lower case]'\
-            '-cu[Convert names to upper case]'\
-            '-df[Delete files after archiving]'\
-            '-dh[Open shared files]'\
-            '-ds[Disable name sort for solid archive]'\
-            '-e[Set file exclude attributes]'\
-            '-ed[Do not add empty directories]'\
-            '-en[Do not put end of archive block]'\
-            '-ep[Exclude paths from name]'\
-            '-ep1[Exclude base directory from names]'\
-            '-ep2[Expand paths to full]'\
-            '-f[Freshen files]'\
-            '-hp[Encrypt both file data and headers]'\
-            '-idp[Disable percentage display]'\
-            '-ierr[Send all messages to stderr]'\
-            '-ilog[Log errors to file (registered versions only)]'\
-            '-inul[Disable all messages]'\
-            '-isnd[Enable sound]'\
-            '-k[Lock archive]'\
-            '-kb[Keep broken extracted files]'\
-            '-m+[Set compression level (0-store...3-default...5-maximal)]:compression level:(( 0\:store 1\:fastest 2\:fast 3\:normal 4\:good 5\:maximal ))'\
-            '-md+[Dictionary size in KB]:dictionaty size in KB:_dico_size' \
-            '-ms[Specify file types to store]'\
-            '-o\+[Overwrite existing files]'\
-            '-o\-[Do not overwrite existing files]'\
-            '-ol[Save symbolic links as the link instead of the file]'\
-            '-ow[Save or restore file owner and group]'\
-            '-p[Set password]'\
-            '-p\-[Do not query password]'\
-            '-r[Recurse subdirectorie]'\
-            '-r0[Recurse subdirectories for wildcard names only]'\
-            '-rr[Add data recovery record]'\
-            '-rv[Create recovery volumes]'\
-            '-s[Create solid archive]'\
-            '-se[Create solid archive using extension]'\
-            '-sv[Create solid archive using volumes]'\
-            '-s\-[Disable solid archiving]'\
-            '-sfx[Create SFX archive]'\
-            '-t[Test files after archiving]'\
-            '-ta[Process files modified after <date> in YYYYMMDDHHMMSS format]'\
-            '-tb[Process files modified before <date> in YYYYMMDDHHMMSS format]'\
-            '-tk[Keep original archive time]'\
-            '-tl[Set archive time to latest file]'\
-            '-tn[Process files newer than <time>]'\
-            '-to[Process files older than <time>]'\
-            '-u[Update files]'\
-            '-v[Create volumes with size autodetection or list all volumes]'\
-            '-ver[File version control]'\
-            '-vn[Use the old style volume naming scheme]'\
-            '-vp[Pause before each volume]'\
-            '-w+[Assign work directory]:work directory:_files -/'\
-            '-x[Exclude specified file]'\
-            '-y[Assume Yes on all queries]'\
-            '-z+[Read archive comment from file]:comment file:_files' \
-            '*:files:_files'
+      _arguments -s \
+	'-ag[generate archive name using the current date]' \
+	'-as[synchronize archive contents]' \
+	'-av[put authenticity verification (registered versions only)]' \
+	'-df[delete files after archiving]' \
+	'-ds[disable name sort for solid archive]' \
+	'-e[set file exclude attributes]' \
+	'-ed[do not add empty directories]' \
+	'-en[do not put end of archive block]' \
+	'-ep1[exclude base directory from names]' \
+	'-ep2[expand paths to full]' \
+	'-hp[encrypt both file data and headers]' \
+	'-ilog[log errors to file (registered versions only)]' \
+	'-isnd[enable sound]' \
+	'-k[lock archive]' \
+	'-m+[set compression level]:compression level:(( 0\:store 1\:fastest 2\:fast 3\:normal 4\:good 5\:maximal ))' \
+	'-md+[dictionary size]:dictionary size (KB):( 64 128 256 512 1024 2048 4096 a b c d e f g )' \
+	'-ms[specify file types to store]' \
+	'-ol[save symbolic links as the link instead of the file]' \
+	'-p[set password]' \
+	'-r0[recurse subdirectories for wildcard names only]' \
+	'-rr[add data recovery record]' \
+	'-rv[create recovery volumes]' \
+	'-s[create solid archive]' \
+	'-se[create solid archive using extension]' \
+	'-sv[create solid archive using volumes]' \
+	'-s\-[disable solid archiving]' \
+	'-sfx[create SFX archive]' \
+	'-t[test files after archiving]' \
+	'-tk[keep original archive time]' \
+	'-tl[set archive time to latest file]' \
+	'-vn[use the old style volume naming scheme]' \
+	'-w+[assign work directory]:work directory:_files -/' \
+	"$common[@]" \
+	'-z+[read archive comment from file]:comment file:_files' \
+	'*:files:_files' && return
     fi
-}
-_rar "$@"
+  ;;
+esac
diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
index b6fa296a1..ee05f4841 100644
--- a/Completion/Unix/Command/_rsync
+++ b/Completion/Unix/Command/_rsync
@@ -15,7 +15,7 @@ if [[ -prefix *::*/ ]]; then
 
     _wanted files expl 'remote files and directories' \
       compadd -d remdispf ${remdispf##* }
-      
+
     _wanted files expl 'remote files and directories' \
       compadd -S/ -d remdispd ${remdispd##* }
 
@@ -45,7 +45,7 @@ elif [[ -prefix 1 *: ]]; then
 
     _wanted files expl 'remote files and directories' \
       compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/}
-      
+
     _wanted files expl 'remote files and directories' \
       compadd -S/ -d remdispd ${${(M)remfiles:#*/}/${slash}(#e)/}
   else
@@ -61,118 +61,91 @@ elif [[ -prefix 1 *@ ]]; then
   _wanted -C user-at hosts expl "host for $user" \
       _combination -s '[:@]' "${tag}" users-hosts users="$user" hosts -S "$suf" "$@" -
 else
-   if compset -S '@*'; then
-      _wanted users expl "user" \
-        _combination -s '[:@]' "${tag}" users-hosts users -q "$@" -
-   else
-	_hosts -S:
-   fi
-
+  if compset -S '@*'; then
+    _wanted users expl "user" \
+	_combination -s '[:@]' "${tag}" users-hosts users -q "$@" -
+  else
+    _alternative 'user:users:_users -S @' 'host:hosts:_hosts -S:'
+  fi
 fi
 
 }
 
 _rsync_files() {
-_files || _rsync_remote_files
+  _alternative "file:files:_files" "remote-files:remote files:_rsync_remote_files"
 }
 
-
-_arguments -C -s \
-	'*:files:_rsync_files' \
- 	'(--verbose)-v[verbose]' \
- 	'(-v)--verbose' \
- 	'(--quiet)-q[quiet]' \
- 	'(-q)--quiet' \
- 	'(--checksum)-c[always checksum]' \
- 	'(-c)--checksum[always checksum]' \
- 	'(--archive)-a[archive mode]' \
- 	'(-a)--archive[archive mode]' \
- 	'(--recursive)-r[recurse into directories]' \
- 	'(-r)--recursive[recurse into directories]' \
- 	'(--relative)-R[use relative path names]' \
- 	'(-R)--relative[use relative path names]' \
- 	'(--backup)-b[make backups]' \
- 	'(-b)--backup[make backups]' \
- 	'--backup-dir[make backups into this directory]:backup directory:_files -/' \
-	'--suffix=[override backup suffix]:suffix:' \
- 	'(--update)-u[update only]' \
- 	'(-u)--update[update only]' \
- 	'(--links)-l[copy symlinks as symlinks]' \
- 	'(-l)--links[copy symlinks as symlinks]' \
- 	'(--copy-links)-L[copy referent of symlinks]' \
- 	'(-L)--copy-links[copy referent of symlinks]' \
- 	'--copy-unsafe-links[copy links outside the source tree]' \
- 	'--safe-links[ignore links outside the destination tree]' \
- 	'(--hard-links)-H[preserve hard links]' \
- 	'(-H)--hard-links[preserve hard links]' \
- 	'(--perms)-p[preserve permissions]' \
- 	'(-p)--perms[preserve permissions]' \
- 	'(--owner)-o[preserve owner]' \
- 	'(-o)--owner[preserve owner]' \
- 	'(--group)-g[preserve group]' \
- 	'(-g)--group[preserve group]' \
- 	'(--devices)-D[preserve devices]' \
- 	'(-D)--devices[preserve devices]' \
- 	'(--times)-t[preserve times]' \
- 	'(-t)--times[preserve times]' \
- 	'(--sparse)-S[handle sparse files efficiently]' \
- 	'(-S)--sparse[handle sparse files efficiently]' \
- 	'(--dry-run)-n[show what would have been transferred]' \
- 	'(-n)--dry-run[show what would have been transferred]' \
- 	'(--whole-file)-W[copy whole files]' \
- 	'(-W)--whole-file[copy whole files]' \
- 	'(--one-file-system)-x[do not cross filesystem boundaries]' \
- 	'(-x)--one-file-system[do not cross filesystem boundaries]' \
- 	'(--block-size)-B[checksum blocking size]:block size:' \
- 	'(-B)--block-size=[checksum blocking size]:block size:' \
- 	'(--rsh)-e[rsh command]:remote command:(rsh ssh)' \
- 	'(-e)--rsh[rsh command]:remote command:(rsh ssh)' \
-	'--rsync-path=[specify path to rsync on the remote machine]:remote command:' \
- 	'(--cvs-exclude)-C[autoignore files in the same way as CVS]' \
- 	'(-C)--cvs-exclude[autoignore files in the same way as CVS]' \
-	'--existing[only update files that already exist]' \
-	'--ignore-existing[ignore files that already exist on the receiving side]' \
-	'--delete[delete files that do not exist on the sending side]' \
-	'--delete-excluded[also delete excluded files on the receiving side]' \
-	'--delete-after[perform delete after transferring]' \
-	'--ignore-errors[delete even if there are IO errors]' \
-	'--max-delete=[do not delete more than NUM files]:number:' \
-	'--partial[keep partially transferred files]' \
-	'--force[force deletion of directories even if not empty]' \
-	'--numeric-ids[do not map uid/gid values by user/group name]' \
-	'--timeout=[set IO timeout in seconds]:seconds:' \
- 	'(--ignore-times)-I[do not exclude files that match length and time]' \
- 	'(-I)--ignore-times[do not exclude files that match length and time]' \
-	'--size-only[only use file size when determining if a file should be transferred]' \
-	'--modify-window=[timestamp window for file match]:seconds:' \
-	'(--temp-dir)-T[create temporary files in specified directory]:directory:_files -/' \
-	'(-T)--temp-dir=[create temporary files in specified directory]:directory:_files -/' \
-	'--compare-dest=[also compare destination files relative to specified directory]:directory:_files -/' \
-	'-P[equivalent to --partial --progress]' \
- 	'(--compress)-z[compress file data]' \
- 	'(-z)--compress[compress file data]' \
-	'--exclude=[exclude files matching pattern]:pattern:' \
-	'--exclude-from=[exclude patterns listed in file]:file:_files' \
-	'--include=[do not exclude files matching pattern]:pattern:' \
-	'--include-from=[do not exclude patterns listed in file]:file:_files' \
-	'--version[print version number]' \
-	'--daemon[run as a rsync daemon]' \
-	'--no-detach[do not detach from the parent]' \
-	'--address=[bind to the specified address]:address:_hosts' \
-	'--config=[specify alternate rsyncd.conf file]:file:_files' \
-	'--port=[specify alternate rsyncd port number]:port:' \
-	'--blocking-io[use blocking IO for the remote shell]' \
-	'--stats[give some file transfer stats]' \
-	'--progress[show progress during transfer]' \
-	'--log-format=[log file transfers using specified format]:format:' \
-	'--password-file=[get password from file]:file:_files' \
-	'--bwlimit=[limit bandwidth]:kbytes per second:' \
-	'--read-batch=[read batch file]:ext:' \
-	'--write-batch[write batch file]' \
- 	'(--help)-h[help]' \
- 	'(-h)--help[help]' \
- 	'-4[prefer IPv4]' \
- 	'-6[prefer IPv6]' \
-	   -- '*=COMMAND*:command:_command' \
-              '*=FILE*:file:_files' \
-              '*=DIR*:directory:_files -/'
+_arguments -s \
+  '*: :_rsync_files' \
+  '*'{-v,--verbose}'[increase verbosity]' \
+  '(-q --quiet)'{-q,--quiet}'[show less information during transfer]' \
+  '(-c --checksum)'{-c,--checksum}'[always checksum]' \
+  '(-a --archive)'{-a,--archive}'[archive mode]' \
+  '(-r --recursive)'{-r,--recursive}'[recurse into directories]' \
+  '(-E --relative)'{-R,--relative}'[use relative path names]' \
+  '(-b --backup)'{-b,--backup}'[make backups]' \
+  '--backup-dir[make backups into specified directory]:backup directory:_directories' \
+  '--suffix=[override backup suffix]:suffix' \
+  '(-u --update)'{-u,--update}'[update only]' \
+  '(-l --links)'{-l,--links}'[copy symlinks as symlinks]' \
+  '(-L --copy-links)'{-L,--copy-links}'[treat soft links like regular files]' \
+  '--copy-unsafe-links[copy links outside the source tree]' \
+  '--safe-links[ignore links outside the destination tree]' \
+  '(-H --hard-links)'{-H,--hard-links}'[preserve hard links]' \
+  '(-p --perms)'{-p,--perms}'[preserve permissions]' \
+  '(-o --owner)'{-o,--owner}'[preserve owner]' \
+  '(-g --group)'{-g,--group}'[preserve group]' \
+  '(-D --devices)'{-D,--devices}'[preserve devices]' \
+  '(-t --times)'{-t,--times}'[preserve times]' \
+  '(-S --sparse)'{-S,--sparse}'[handle sparse files efficiently]' \
+  '(-n --dry-run)'{-n,--dry-run}'[show what would have been transferred]' \
+  '(-W --whole-file --no-whole-file)'{-W,--whole-file}'[copy whole files]' \
+  '(-W --whole-file)--no-whole-file[always use incremental rsync algorithm]' \
+  '(-x --one-file-system)'{-x,--one-file-system}'[do not cross filesystem boundaries]' \
+  '(-B --block-size)'{-B,--block-size=}'[checksum blocking size]:block size' \
+  '(-e --rsh)'{-e,--rsh}'[rsh command]:remote command:(rsh ssh)' \
+  '--rsync-path=[specify path to rsync on the remote machine]:remote command:' \
+  '(-C --cvs-exclude)'{-C,--cvs-exclude}'[autoignore files in the same way as CVS]' \
+  '--existing[only update files that already exist]' \
+  '--ignore-existing[ignore files that already exist on the receiving side]' \
+  '--delete[delete files that do not exist on the sending side]' \
+  '--delete-excluded[also delete excluded files on the receiving side]' \
+  '--delete-after[perform delete after transferring]' \
+  '--ignore-errors[delete even if there are IO errors]' \
+  '--max-delete=[do not delete more than NUM files]:number:' \
+  '(-P)--partial[keep partially transferred files]' \
+  '--force[force deletion of directories even if not empty]' \
+  '--numeric-ids[do not map uid/gid values by user/group name]' \
+  '--timeout=[set IO timeout in seconds]:seconds:' \
+  '(-I --ignore-times)'{-I,--ignore-times}'[do not exclude files that match length and time]' \
+  '--size-only[only use file size when determining if a file should be transferred]' \
+  '--modify-window=[timestamp window for file match]:seconds:' \
+  '(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_files -/' \
+  '--compare-dest=[also compare destination files relative to specified directory]:directory:_files -/' \
+  '(--partial --progress)-P[equivalent to --partial --progress]' \
+  '(-z --compress)'{-z,--compress}'[compress file data]' \
+  '--exclude=[exclude files matching pattern]:pattern:' \
+  '--exclude-from=[exclude patterns listed in file]:file:_files' \
+  '--include=[do not exclude files matching pattern]:pattern:' \
+  '--include-from=[do not exclude patterns listed in file]:file:_files' \
+  '--version[print version number]' \
+  '--daemon[run as a rsync daemon]' \
+  '--no-detach[do not detach from the parent]' \
+  '--address=[bind to the specified address]:address:_hosts' \
+  '--config=[specify alternate rsyncd.conf file]:file:_files' \
+  '--port=[specify alternate rsyncd port number]:port:' \
+  '--blocking-io[use blocking IO for the remote shell]' \
+  '--no-blocking-io[turn off blocking IO when it is the default]' \
+  '--stats[give some file transfer stats]' \
+  '(-P)--progress[show progress during transfer]' \
+  '--log-format=[log file transfers using specified format]:format:' \
+  '--password-file=[get password from file]:file:_files' \
+  '--bwlimit=[limit bandwidth]:kbytes per second:' \
+  '--read-batch=[read batch file]:ext:' \
+  '--write-batch[write batch file]' \
+  '(-)'{-h,--help}'[display help information]' \
+  '-4[prefer IPv4]' \
+  '-6[prefer IPv6]' \
+     -- '*=COMMAND*:command:_command' \
+	'*=FILE*:file:_files' \
+	'*=DIR*:directory:_files -/'
diff --git a/Completion/Unix/Command/_slrn b/Completion/Unix/Command/_slrn
index a063e227c..299b2a743 100644
--- a/Completion/Unix/Command/_slrn
+++ b/Completion/Unix/Command/_slrn
@@ -1,16 +1,25 @@
 #compdef slrn
 
 _arguments \
-    '-n[do not check for new groups]' \
-    '-h[NNTP host]:NNTP host:_hosts' \
-    '-p[NNTP port]:NNTP port:_ports' \
-    '-f[name of the newsrc file to use]:the newsrc file to use:_files' \
-    '-C[use colors]' \
-    '-create[create a newsrc file by getting list of groups from server]' \
-    '-d[get new text descriptions of each group from server]' \
-    '-i[name of initialization file to use]:initialization file to use:_files' \
-    '-D-[add predefined preprocessing token]' \
-    '-k[do not process score file]' \
-    '-k0[process score file but inhibit expensive scores]' \
-    '-a[use active file for getting new news]' \
-    '-m[force XTerm mouse reporting]'
+  '-n[do not check for new groups]' \
+  '-h[NNTP host]:NNTP host:_hosts' \
+  '-p[NNTP port]:NNTP port:_ports' \
+  '-f[name of the newsrc file to use]:newsrc file:_files' \
+  '(-C\-)-C[use colors]' \
+  "(-C)-C\-[don't use colors]" \
+  '-d[get new text descriptions of each group from server]' \
+  '-i[specify initialization file to use]:config file:_files' \
+  '-D-[add predefined preprocessing token]' \
+  '-k[do not process score file]' \
+  '-k0[process score file but inhibit expensive scores]' \
+  '-a[use active file for getting new news]' \
+  '-m[force XTerm mouse reporting]' \
+  '-w[wait for a key before switching to full screen mode]' \
+  '--create[create a newsrc file by getting list of groups from server]' \
+  '--debug[write debugging output to specified file]:debug file:_files' \
+  '(-)--help[show help information]' \
+  '--inews[use an external inews program to post articles]' \
+  '--kill-log[keep a log of articles  killed by the scorefile]:log file:_files' \
+  '--nntp[use builtin NNTP support]' \
+  '--pull[spool outgoing articles locally]' \
+  '--spool[read directly from spool]' \
diff --git a/Completion/Unix/Command/_user_admin b/Completion/Unix/Command/_user_admin
index f56b20d37..4e7c1d487 100644
--- a/Completion/Unix/Command/_user_admin
+++ b/Completion/Unix/Command/_user_admin
@@ -7,7 +7,7 @@ redhat=$?
 
 if [[ $service = user* ]]; then
   if [[ -r /etc/shells ]]; then
-    shells=( $(</etc/shells) )
+    shells=( ${${(f)"$(</etc/shells)"}:#\#*} )
   else
     shells=( ${(M)commands:#*/(|[abckz]|tc|ba)sh} )
   fi
@@ -24,7 +24,7 @@ if [[ $service = user* ]]; then
     '(-D)-u[uid]:uid'
     '(-D)-o[allow non unique uid]'
   )
-  [[ $OSTYPE = linux* ]] && args=( $args[@] 
+  [[ $OSTYPE = linux* ]] && args=( $args[@]
       '(-D -U -L)-p+[specify encrypted password]:encrypted password' )
 
   if [[ $service = useradd ]]; then
@@ -58,7 +58,7 @@ else
       '-f[force]'
     )
   else
-    args=( $args[@] 
+    args=( $args[@]
       '-n[specify new group name]:new group name'
       ':group name:_groups'
     )
diff --git a/Completion/Unix/Command/_vorbis b/Completion/Unix/Command/_vorbis
index 8dd078b0d..93122b91c 100644
--- a/Completion/Unix/Command/_vorbis
+++ b/Completion/Unix/Command/_vorbis
@@ -1,99 +1,91 @@
-#compdef oggenc ogg123 ogginfo oggdec 
+#compdef oggenc ogg123 ogginfo oggdec
 
-_advanced_option() {
-    _values "options name" \
-        'bitrate_average_window[set  the  managed bitrate window to NN seconds.]:number:'\
-        'lowpass_frequency[set the lowpass frequency to NN kHz.]:number:'
-}
-_vorbis (){
-    local expl
-    case $service in
-    oggenc)
-        _arguments -C -s \
-    {'(--help)-h','(-h)--help'}'[show help]'\
-    {'(--raw)-r','(-r)--raw'}'[assume input data is raw little-endian audio data with no header information.]'\
-    {'(--raw-bits=)-B','(-B)--raw-bits='}'[sets raw mode input sample size in bits.]:sample size:(8 16)'\
-    {'(--raw-chan=)-C','(-C)--raw-chan='}'[sets raw mode input number of channels.]:number of channels:'\
-    {'(--raw-rate=)-R','(-R)--raw-rate='}'[sets raw mode input samplerate.]:samplerate:(44100 48000)'\
-    '--raw-endianness[sets raw mode endianness]:endianness:(( 0\:big\ endian 1\:little\ endian ))'\
-    {'(--quiet)-Q','(-Q)--quiet'}'[quiet mode.]'\
-    {'(--bitrate=)-b','(-b)--bitrate='}'[sets encoding to the bitrate closest to n (in kb/s).]:bitrate in kb/s:'\
-    {'(--min-bitrate=)-m','(-m)--min-bitrate='}'[sets minimum bitrate to n (in kb/s).]:bitrate in kb/s:'\
-    {'(--max-bitrate=)-M','(-M)--max-bitrate='}'[sets maximum bitrate to n (in kb/s).]:bitrate in kb/s:'\
-    '--managed[turn  off  the  normal  VBR encoding]'\
-    {'(--quality=)-q','(-q)--quality='}'[sets encoding quality.]:quality:(0 1 2 3 4 5 6 7 8 9 10)'\
-    '--resample[resample input to the given sample rate (in Hz) before encoding.]:sample rate:'\
-    '--downmix[downmix input from stereo to mono.]'\
-    '--advanced-encode-option[sets  an  advanced  option.]:option name:_advanced_option'\
-    {'(--serial)-s','(-s)--serial'}'[forces a specific serial number in the output  stream.]'\
-    {'(--output-file=)-o','(-o)--output-file='}'[write the Ogg Vorbis stream to output_file]:files:->oggfiles'\
-    {'(--pattern=)-n','(-n)--pattern='}'[produce filenames as this string]:string:'\
-    {'*-c','*--comment'}'[add the string comment as an extra comment.]:comment:'\
-    {'*-a','*--artist'}'[set the artist comment field in the comments to artist.]:artist:'\
-    {'*-G','*--genre'}'[set the genre comment field in the comments to genre.]:genre:'\
-    {'*-d','*--date'}'[sets the date comment field to the given value.]:date:'\
-    {'*-N','*--tracknum'}'[sets the track number comment field to the given value.]:track number:'\
-    {'*-t','*--title'}'[set the track title comment field to title.]:title:'\
-    {'*-l','*--album'}'[set the album comment field to album.]'\
-    '*:files:->wavfiles' && return 0
-        ;;
-    ogg123)
-        _arguments -C -s \
-        {'(-h)--help','(--help)-h'}'[show help]'\
-        {'(--version)-V','(-V)--version'}'[display version information.]'\
-        {'(-d)--device','(--device)-d'}'[output device.]:device:((null\:"discards all data" oss\:"Open Sound System" sun\:"Sun Audio" alsa\:"Advanced Linux Sound Architecture" irix\:"IRIX audio" arts\:"aRts Sound Daemon" esd\:"Enlightened Sound Daemon" au\:"Sun audio file" raw\:"Raw sample" wav\:"WAV file"))' \
-        {'(--files=)-f','(-f)--files='}'[output filename for a previously specified file device.]:output filename:_files'\
-        {'(--skip)-k','(-k)--skip'}'[skip the first '\''n'\'' seconds.]:seconds:'\
-        {'(--buffer)-b','(-b)--buffer'}'[size of input buffer.]:kilobytes:'\
-        {'(--prebuffer)-p','(-p)--prebuffer'}'[prebuffer percentage.]:percent:'\
-        {'(--quiet -q)*-v','(--quiet -q)*--verbose'}'[increase verbosity.]'\
-        {'(--verbose -v --quiet)-q','(-q --verbose -v)--quiet'}'[quiet mode.]'\
-        {'(--nth)-x','(-x)--nth'}'[block decode intervall.]:number:'\
-        {'(--ntimes)-y','(-y)--ntimes'}'[block repeat count.]:number:'\
-        {'(--shuffle)-z','(-z)--shuffle'}'[shuffle play.]'\
-        {'(--delay=)-l','(-l)--delay='}'[set delay in millisecond.]:milliseconds:'\
-        {'(--playlist)-@','(-@)--playlist'}'[Play all of  the  files from a playlist.]:playlist:_files'\
-        '--audio-buffer[size of output audio buffer.]:kilobytes:'\
-        {'*-o','*--device-option='}'[assign device option values]:devopts:->devopts'\
-        '*:files:->oggfiles' && return 0
-        ;;
-    ogginfo)
-        _arguments -C -s \
-        '-h[show a help and usage message]'\
-        '*-q[quiet  mode.]'\
-        '-v[verbose mode.]'\
-        '*:files:->oggfiles' && return 0
-        ;;
-    oggdec)
-        _arguments -C -s \
-        {'(--quiet)-q','(-q)--quiet'}'[quiet mode.]'\
-        {'(--help)-h','(-h)--help'}'[print help message.]'\
-        {'(--version)-v','(-v)--version'}'[display version information.]'\
-        {'(--bits=)-b','(-b)--bits='}'[bits per sample.]:bits per sample:(8 16)'\
-        {'(--endian=)-e','(-e)--endian'}'[set endianness for 16-bit output.]:endianness:(( 0\:\(default\)\ is\ little-endian\ \(Intel\ byte\ order\). 1\:is\ big-endian\ \(sane\ byte\ order\). ))'\
-        {'(--raw=)-R','(-R)--raw='}'[output  in  raw format.]'\
-        {'(--output=)-o','(-o)--output='}'[write output to specified filename.]:output filename:_files'\
-	    {'(--sign=)-s','(-s)--sign='}'[set signedness for output.]:signedness:(( 0\:unsigned 1\:signed\ \(default\) ))'\
-        '*:files:->oggfiles' && return 0
-        ;;
-    esac
+local expl ret=1
 
-    case $state in
-    oggfiles)
-    _description files expl 'ogg vorbis files'
-    _files "$expl[@]" -g '*.ogg'
-    ;;
-    wavfiles)
-    _description files expl 'wav files'
-    _files "$expl[@]" -g '*.wav'
-    ;;
-    devopts)
-    _setup devopts
-    _tags devopts
-    _description devopts expl 'device options'
-    compadd "$expl[@]" -S : - dsp dev card buf_size host byteorder
-    ;;
-    esac
-}
+case $service in
+  oggenc)
+    _arguments -s \
+      '(-)'{-h,--help}'[show help]' \
+      '(-r --raw)'{-r,--raw}'[assume input data is raw little-endian audio data with no header information]' \
+      '(-B --raw-bits)'{-B,--raw-bits=}'[set raw mode input sample size in bits]:sample size:(8 16)' \
+      '(-C --raw-chan)'{-C,--raw-chan=}'[set raw mode input number of channels]:number of channels' \
+      '(-R --raw-rate)'{-R,--raw-rate=}'[set raw mode input sample rate]:sample rate:(44100 48000)' \
+      '--raw-endianness[set raw mode endianness]:endianness:((0\:big\ endian 1\:little\ endian))' \
+      '(-Q --quiet)'{-Q,--quiet}'[quiet mode]' \
+      '(-b --bitrate)'{-b,--bitrate=}'[set encoding to the bitrate closest to that specified]:bitrate (kb/s)' \
+      '(-m --min-bitrate)'{-m,--min-bitrate=}'[set minimum bitrate]:bitrate (kb/s)' \
+      '(-M --max-bitrate)'{-M,--max-bitrate=}'[set maximum bitrate]:bitrate (kb/s)' \
+      '--managed[turn off the normal VBR encoding]' \
+      '(-q --quality)'{-q,--quality=}'[set encoding quality]:quality:(0 1 2 3 4 5 6 7 8 9 10)' \
+      '--resample[resample input to the given sample rate before encoding]:sample rate (Hz)' \
+      '--downmix[down mix input from stereo to mono]' \
+      '--advanced-encode-option:option name:_values option "bitrate_average_window[set the managed bitrate window]\:number (seconds)" "lowpass_frequency[set the lowpass frequency]\:frequency (kHz)"' \
+      '(-s --serial)'{-s,--serial}'[force a specific serial number in the output stream]' \
+      '(-o --output-file)'{-o,--output-file=}'[write the Ogg Vorbis stream to output_file]:files:->oggfiles' \
+      '(-n --pattern)'{-n,--pattern=}'[specify pattern for producing filenames]:string' \
+      '(-c --comment)'{-c,--comment}'[add the string comment as an extra comment]:comment' \
+      '(-a --artist)'{-a,--artist}'[set the artist comment field in the comments to artist]:artist' \
+      '(-G --genre)'{-G,--genre}'[set the genre comment field in the comments to genre]:genre' \
+      '(-d --date)'{-d,--date}'[set the date comment field to the given value]:date' \
+      '(-N --tracknum)'{-N,--tracknum}'[set the track number comment field to the given value]:track number' \
+      '(-t --title)'{-t,--title}'[set the track title comment field to title]:title' \
+      '(-l --album)'{-l,--album}'[set the album comment field to album]' \
+      '*:wav file:_files -g "(#i)*.wav"' && ret=0
+  ;;
+  ogg123)
+    _arguments -C -s \
+      '(-h --help)'{-h,--help}'[show help]' \
+      '(-)'{-V,--version}'[display version information]' \
+      '(-d --device)'{-d,--device}'[output device]:device:((null\:discard\ all\ data oss\:open\ sound\ system sun\:sun\ audio alsa\:advanced\ linux\ sound\ architecture irix\:IRIX\ audio arts\:aRts\ sound\ daemon esd\:enlightened\ sound\ daemon au\:sun\ audio\ file raw\:raw\ sample wav\:wav\ file))' \
+      '(-f --files)'{-f,--files=}'[output filename for a previously specified file device]:output filename:_files' \
+      '(-k --skip)'{-k,--skip}'[skip the first '\''n'\'' seconds]:seconds' \
+      '(-b --buffer)'{-b,--buffer}'[size of input buffer]:kilobytes' \
+      '(-p --prebuffer)'{-p,--prebuffer}'[prebuffer percentage]:percent' \
+      '(-q --quiet)'{*-v,*--verbose}'[increase verbosity]' \
+      '(-q --quiet -v --verbose)'{--quiet,-q}'[quiet mode]' \
+      '(-x --nth)'{-x,--nth}'[block decode intervall]:number' \
+      '(-y --ntimes)'{-y,--ntimes}'[block repeat count]:number' \
+      '(-z --shuffle)'{-z,--shuffle}'[shuffle play]' \
+      '(-l --delay)'{-l,--delay=}'[set delay]:delay (ms)' \
+      '(-@ --playlist)'{-@,--playlist}'[play all of  the  files from a playlist]:playlist:_files' \
+      '--audio-buffer[size of output audio buffer]:kilobytes' \
+      {'*-o','*--device-option='}'[assign device option values]:device option:->devopts' \
+      '*:files:->oggfiles' && ret=0
+  ;;
+  ogginfo)
+    _arguments -C -s \
+      '-h[show a help and usage message]' \
+      '*-q[quiet  mode]' \
+      '-v[verbose mode]' \
+      '*:files:->oggfiles' && ret=0
+  ;;
+  oggdec)
+    _arguments -C -s \
+      '(-q --quiet)'{-q,--quiet}'[quiet mode]' \
+      '(-)'{-h,--help}'[print help information]' \
+      '(-)'{-v,--version}'[display version information]' \
+      '(-b --bits)'{-b,--bits=}'[bits per sample]:bits per sample:(8 16)' \
+      '(-e --endian)'{-e,--endian=}'[set endianness for 16-bit output]:endianness:((0\:\(default\)\ little-endian\ \(Intel\ byte\ order\) 1\:big-endian\ \(sane\ byte\ order\)))' \
+      '(-R --raw)'{-R,--raw=}'[output in raw format]' \
+      '(-o --output)'{-o,--output=}'[write output to specified filename]:output filename:_files' \
+      '(-s --sign)'{-s,--sign=}'[set signedness for output]:signedness:((0\:unsigned 1\:signed\ \(default\)))' \
+      '*:files:->oggfiles' && ret=0
+  ;;
+esac
 
-_vorbis "$@"
+case $state in
+  oggfiles)
+    _wanted files expl 'ogg vorbis file' \
+	_files "$expl[@]" -g '(#i)*.ogg' && return
+  ;;
+  devopts)
+    if compset -p '*:'; then
+      _message -e value value
+    else
+      _wanted devopts expl 'device option' \
+	  compadd -S : - dsp dev card buf_size host byteorder && return
+    fi
+  ;;
+esac
+
+return ret
diff --git a/Completion/X/Command/_acroread b/Completion/X/Command/_acroread
index acb7c8b81..051a32151 100644
--- a/Completion/X/Command/_acroread
+++ b/Completion/X/Command/_acroread
@@ -1,52 +1,43 @@
 #compdef acroread
 
-local context state line
-typeset -A opt_args
+local curcontext="$curcontext" state line
 
-local global_opts
-global_opts=(
-    "*:pdf_file_1 [pdf_file_2] ...:_files -g '*.(#i)pdf'"
-    "-display:host\:display:"
-    "-geometry:[<width>x<height>][{+|-}<x offset>{+|-}<y offset>]:"
-    -help
-    -helpall
-    \*-iconic
-    \*+iconic
-    "-name:application name:"
-    "*-setenv:<var>=<value>:"
-    -tempFile
-    "-tempFileTitle:title:"
-    "(+useFrontEndProgram)-useFrontEndProgram" "(-useFrontEndProgram)+useFrontEndProgram"
-    "-visual:or <visual class> [depth=<depth>]:(id= best default)"
-    "-xrm:X resource specification:"
-    "-toPostScript:*::PostScript conversion options:= ->tops"
-)
+_x_arguments -C \
+  -help \
+  -helpall \
+  \*-iconic \
+  \*+iconic \
+  '-name:application name:_x_name' \
+  '*-setenv:<var>=<value>' \
+  -tempFile \
+  '-tempFileTitle:title' \
+  '(+useFrontEndProgram)-useFrontEndProgram' \
+  '(-useFrontEndProgram)+useFrontEndProgram' \
+  '-visual:X visual:_x_visual' \
+  '-xrm:X resource specification:_x_resource' \
+  '-toPostScript:*::PostScript conversion options:= ->tops' \
+  '*:pdf file:_files -g "*.(#i)pdf"' && return
 
-local tops_opts
-tops_opts=(
-    "-pairs:*:pdf_file_1 ps_file_1 ...:_files -g '*.(#i)(pdf|ps)'"
-    -binary
-    "-start:integer:"
-    "-end:integer:"
-    -optimizeForSpeed
-    -landscape
-    -reverse
-    "(-even)-odd"
-    "(-odd)-even"
-    -commentsOff
-    "(-level2 -level3)-level1"
-    "(-level1 -level3)-level2"
-    "(-level1 -level2)-level3"
-    -printerhalftones
-    -saveVM
-    "-scale:integer:"
-    -shrink
-    "-size:page size (or custom size wxh in points):(letter tabloid ledger legal executive a3 a4 a5 b4 b5)"
-    "-transQuality:transparency flattening level:(1 2 3 4 5)"
-    "*:pdf_file ... [ps_dir]:_files -g '*.(#i)pdf'"
-)
-
-_arguments $global_opts && return 0
-[[ "$state" = tops ]] && _arguments $tops_opts && return 0
+[[ -n "$state" ]] && _arguments \
+  '-pairs:*:pdf_file_1 ps_file_1 ...:_files -g "*.(#i)(pdf|ps)"' \
+  -binary \
+  '-start:integer' \
+  '-end:integer' \
+  -optimizeForSpeed \
+  -landscape \
+  -reverse \
+  '(-even)-odd' \
+  '(-odd)-even' \
+  -commentsOff \
+  '(-level2 -level3)-level1' \
+  '(-level1 -level3)-level2' \
+  '(-level1 -level2)-level3' \
+  -printerhalftones \
+  -saveVM \
+  '-scale:integer' \
+  -shrink \
+  '-size:page size (or custom size wxh in points):(letter tabloid ledger legal executive a3 a4 a5 b4 b5)' \
+  '-transQuality:transparency flattening level:(1 2 3 4 5)' \
+  '*:pdf file:_files -g "*.(#i)pdf"' && return
 
 return 1
diff --git a/Completion/X/Type/_x_color b/Completion/X/Type/_x_color
index c4e54363d..960eae6d3 100644
--- a/Completion/X/Type/_x_color
+++ b/Completion/X/Type/_x_color
@@ -30,6 +30,5 @@ if (( ! $+_color_cache )); then
   (( $#_color_cache )) || _color_cache=(white black gray red blue green)
 fi
 
-_wanted colors expl 'color specification' \
-    compadd "$@" -M 'm:{a-z}={A-Z} m:-=\  r:[^ A-Z0-9]||[ A-Z0-9]=* r:|=*' -a \
-            _color_cache
+_wanted colors expl 'color specification' compadd "$@" -M \
+    'm:{a-z}={A-Z} m:-=\  r:[^ A-Z0-9]||[ A-Z0-9]=* r:|=*' -a - _color_cache