about summary refs log tree commit diff
path: root/Completion/X
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-07-31 15:26:13 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-07-31 15:26:13 +0000
commitb84399b9cbb93f199d695d7cb264c44178a8d5e0 (patch)
treeaf329c706dd4104718b02c78e2009f9488ad59e5 /Completion/X
parent27665b32d6e1f60d6e786baa2478aa396f7e9b98 (diff)
downloadzsh-b84399b9cbb93f199d695d7cb264c44178a8d5e0.tar.gz
zsh-b84399b9cbb93f199d695d7cb264c44178a8d5e0.tar.xz
zsh-b84399b9cbb93f199d695d7cb264c44178a8d5e0.zip
tidy up of many completions (updates, fixes, improvements and plain aesthetics)
Diffstat (limited to 'Completion/X')
-rw-r--r--Completion/X/Command/_acroread83
-rw-r--r--Completion/X/Type/_x_color5
2 files changed, 39 insertions, 49 deletions
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