summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_imagemagick9
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 83775b12b..857bf1046 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-17  Mikael Magnusson  <mikachu@gmail.com>
+
+	* 36172: Completion/Unix/Command/_imagemagick: Use $formats a
+	bit more correctly
+
 2015-08-17  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* unposted (cf. 36200): Completion/Base/Completer/_expand: back out
diff --git a/Completion/Unix/Command/_imagemagick b/Completion/Unix/Command/_imagemagick
index 115cb01e4..1fc6089c8 100644
--- a/Completion/Unix/Command/_imagemagick
+++ b/Completion/Unix/Command/_imagemagick
@@ -1,6 +1,7 @@
 #compdef animate composite combine convert display identify import mogrify montage xtp
 
-local state line expl formats curcontext="$curcontext"
+local state line expl curcontext="$curcontext"
+local -a formats
 typeset -A opt_args
 
 # Things that could be improved:
@@ -11,10 +12,10 @@ typeset -A opt_args
 #
 # and certainly many other things...
 
-formats=jpg:jpeg:jp2:j2k:jpc:jpx:jpf:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv
+formats=(jpg jpeg jp2 j2k jpc jpx jpf tiff miff ras bmp cgm dcx ps eps fig fits fpx gif mpeg pbm pgm ppm pcd pcl pdf pcx png rad rgb rgba rle sgi html shtml tga ttf uil xcf xwd xbm xpm yuv)
 
 if (( $# )); then
-  _files "$@" -g "*.(#i)(${~formats//:/|})(-.)"
+  _files "$@" -g "*.(#i)(${(j:|:)formats})(-.)"
   return
 fi
 
@@ -444,7 +445,7 @@ case "$service" in
       '*-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]' \
-      "*-format:output file format:(${formats//:/ })" \
+      "*-format:output file format:($formats)" \
       '*-font:annotation font:_x_font' \
       '*-frame:border dimensions (<width>x<height>+<out>+<in>)' \
       '*-fuzz:maximum distance for equal colors' \