1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 21:51:40 +02:00

36172: _imagemagick: Use $formats a bit more correctly

This commit is contained in:
Mikael Magnusson 2015-08-15 00:33:20 +02:00
parent c5a13d2d01
commit fb063f9649
2 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -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' \