mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-26 18:01:03 +02:00
16384: new completion for xli/xloadimage and factor out completion of X visuals
This commit is contained in:
parent
bc10b0e0a5
commit
8074e07a2c
9 changed files with 108 additions and 6 deletions
|
@ -1,3 +1,12 @@
|
|||
2002-01-02 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 16384: Completion/X/Type/.distfiles, Completion/X/Type/_x_visual,
|
||||
Completion/X/Command/.distfiles, Completion/X/Command/_xloadimage,
|
||||
Completion/X/Command/_netscape, Completion/X/Command/_x_utils,
|
||||
Completion/X/Command/_xfig, Completion/X/Command/_xv:
|
||||
new completion for xli/xloadimage and factor out completion
|
||||
of X visuals
|
||||
|
||||
2001-12-26 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 16375: Completion/Unix/Command/.distfiles,
|
||||
|
|
|
@ -2,5 +2,5 @@ DISTFILES_SRC='
|
|||
.distfiles
|
||||
_gv _netscape _xauth _xfig _xrdb _xterm _xwit
|
||||
_nedit _vnc _x_utils _xdvi _xmodmap _xset _xv
|
||||
_mozilla
|
||||
_mozilla _xloadimage
|
||||
'
|
||||
|
|
|
@ -7,7 +7,7 @@ _x_arguments -C \
|
|||
'-xrm:resource:_x_resource' \
|
||||
'-help[show usage message]' \
|
||||
'-version[show the version number and build date]' \
|
||||
'-visual[use a specific server visual]:id-or-number:' \
|
||||
'-visual[use a specific server visual]:visual:_x_visual -b' \
|
||||
'-install[install a private colormap]' \
|
||||
'-no-install[use the default colormap]' \
|
||||
'-ncols[max no. of colors to allocate for images]:n:' \
|
||||
|
|
|
@ -138,7 +138,7 @@ xwud)
|
|||
'-in:input file:_files -g \*.\(\#i\)xwd' \
|
||||
'-plane:image plane to display:' \
|
||||
'-std:standard colormap:(best default gray red blue green)' \
|
||||
'-vis:visual class:(StaticGray GrayScale StaticColor PseudoColor DirectColor TrueColor)'
|
||||
'-vis:visual:_x_visual'
|
||||
;;
|
||||
xrdb)
|
||||
_x_arguments \
|
||||
|
|
|
@ -29,6 +29,6 @@ _x_arguments \
|
|||
'-starttextstep:text step:' \
|
||||
'-userscale:scale factor:' \
|
||||
'-userunit:unit string:' \
|
||||
'-visual:visual:(TrueColor StaticColor DirectColor StaticGray GrayScale PseudoColor)' \
|
||||
'-visual:visual:_x_visual' \
|
||||
'-zoom:zoom scale:' \
|
||||
'*:xfig file:_files -g \*.\(\#i\)\(\|x\)fig'
|
||||
|
|
85
Completion/X/Command/_xloadimage
Normal file
85
Completion/X/Command/_xloadimage
Normal file
|
@ -0,0 +1,85 @@
|
|||
#compdef xli xloadimage xsetbg xview
|
||||
|
||||
local rc ipath extension filter type args
|
||||
|
||||
if rc=( ${(f)"$($words[1] -path)"} ); then
|
||||
# xli
|
||||
filter=( .Z )
|
||||
args=(
|
||||
'-cache[force caching of entire input]'
|
||||
"-delete[enable deleting images with 'x' key]"
|
||||
'-dispgamma[specify gamma correction]'
|
||||
'-fillscreen[use whole screen, zooming image]'
|
||||
'-focus[take keyboard focus]'
|
||||
'-path[display image path and suffixes]'
|
||||
-dumpcore
|
||||
'*-iscale[scale image]:scale factor'
|
||||
'*-c'{,olor}'dither[dither image]'
|
||||
'*-expand[expand image to 24-bit]'
|
||||
'*-xpm[specify xpm color map]:color context key:(m g4 g c)'
|
||||
)
|
||||
else
|
||||
# xloadimage
|
||||
rc=( ${(f)"$($words[1] -configuration)"} )
|
||||
filter=( ${${(Q)rc[4,-1]%% -*}# } )
|
||||
type=( ${(f)"$($words[1] -supported)"} )
|
||||
args=(
|
||||
'-configuration[display image path, suffixes and filters]'
|
||||
'-dump[dump image into file]:image type:( '${(F)${(M)type:#*Yes*}%% *}' ):filename:_files'
|
||||
-slideshow
|
||||
'*-type[force type of image]:type name:( '${(F)type[3,-1]%% *}' )'
|
||||
'*-shrink[shrink image to fit display]'
|
||||
'*-tile[tile image to fill display]'
|
||||
'*-global[following option applies to all images]'
|
||||
)
|
||||
fi
|
||||
ipath=( . ${=rc[1]#*:} )
|
||||
extension=( ${=rc[2]#*:} )
|
||||
|
||||
# all options are valid after -help so no exclusion lists below
|
||||
_x_arguments "$args[@]" \
|
||||
'-default[set root background to default]' \
|
||||
'-fit[use default visual and colormap]' \
|
||||
'-fullscreen[use whole screen, suurounding image with border]' \
|
||||
"-goto[specify image to display at end]:image name:_files -W ipath -g '*(#i)(${(j:|:)extension})(|${(j:|:)filters})'" \
|
||||
'(*)-help[display information on options]' \
|
||||
'-identity[identify supplied images instead of displaying]' \
|
||||
'-install[forcibly install image colormap on focus]' \
|
||||
'-list[list images]' \
|
||||
'-onroot[display to root window]' \
|
||||
'-path[display image path and suffixes]' \
|
||||
'-pixmap[force the use of a pixmap as backing-store]' \
|
||||
'-private[force use of a private colormap]' \
|
||||
'-quiet[quiet operation]' \
|
||||
'-supported[list supported image types]' \
|
||||
'-verbose[verbose operation]' \
|
||||
'-version[display version info]' \
|
||||
'-view[view image in window]' \
|
||||
'-visual[force use of a specific visual]:visual:_x_visual' \
|
||||
'-windowid[set background pixmap of specific window]:window id:_x_window' \
|
||||
-fork -debug \
|
||||
'*-border[specify background color]:background color:_x_color' \
|
||||
'*-brighten[brighten/darken image]:percentage multiplier' \
|
||||
'*-colors[specify maximum colors in image]:colors' \
|
||||
'*-delay[delay before advancing to next image]:seconds' \
|
||||
'*-dither[dither color image to mono]' \
|
||||
'*-gamma[specify gamma of display image was intended for]:gamma' \
|
||||
'*-gr'{a,e}'y[convert image to grayscale]' \
|
||||
'*-idelay[specify delay for this image]' \
|
||||
'*-smooth[smooth a color image]' \
|
||||
'*-xzoom[zoom X axis of image]:percentage' \
|
||||
'*-yzoon[zoom Y axis of image]:percentage' \
|
||||
'*-zoom:percentage' \
|
||||
'*-newoptions[reset options]' \
|
||||
'*-at[specify coordinates to load next image at]' \
|
||||
'*-background[specify background color for next image]:color:_x_color' \
|
||||
'*-center[center next image on base image]' \
|
||||
'*-clip:X,Y,W,H' \
|
||||
'*-foreground[specify foreground color for next image]:color:_x_color' \
|
||||
'*-halftone[force halftone dithering]' \
|
||||
'*-invert[invert a monochrome image]' \
|
||||
'*-merge[merge image onto the base image]' \
|
||||
"*-name[specify image name]:picture file:_files -W ipath -g '*(#i)(${(j:|:)extension})(|${(j:|:)filters})'" \
|
||||
'*-normalize' \
|
||||
'*-rotate[rotate image clockwise]:degrees of rotation:(90 180 270)' \
|
||||
"*:picture file:_files -W ipath -g '*(#i)(${(j:|:)extension})(|${(j:|:)filter})'"
|
|
@ -29,7 +29,7 @@ _x_arguments \
|
|||
'-white:'"'"'white'"'"' color:_x_color' \
|
||||
'-black:'"'"'black'"'"' color:_x_color' \
|
||||
'-wait:seconds to wait:' \
|
||||
'-visual:visual:(TrueColor StaticColor DirectColor StaticGray GrayScale PseudoColor)' \
|
||||
'-visual:visual:_x_visual' \
|
||||
'-cursor:cursor character number:' \
|
||||
'-icgeometry:icon geometry:_x_geometry' \
|
||||
'-dir:directory:_files -/' \
|
||||
|
|
|
@ -5,5 +5,5 @@ _x_color _x_geometry _x_selection_timeout
|
|||
_x_colormapid _x_keysym _x_title
|
||||
_x_cursor _x_locale _x_window
|
||||
_x_display _x_modifier _xt_session_id
|
||||
_x_extension _x_name
|
||||
_x_extension _x_name _x_visual
|
||||
'
|
||||
|
|
8
Completion/X/Type/_x_visual
Normal file
8
Completion/X/Type/_x_visual
Normal file
|
@ -0,0 +1,8 @@
|
|||
#autoload
|
||||
|
||||
# with the -b option, include `Best' in the matches
|
||||
local best="${argv[(r)-b]:+Best}"
|
||||
argv[(i)-b]=()
|
||||
|
||||
_wanted visuals expl visual compadd "$@" -M 'm:{a-zA-Z}={A-Za-z}' - \
|
||||
$best DirectColor TrueColor PseudoColor StaticColor GrayScale StaticGray
|
Loading…
Reference in a new issue