mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 10:41:11 +02:00
zsh-workers/7517
This commit is contained in:
parent
bd29ea48ec
commit
df7d6b3e43
21 changed files with 225 additions and 59 deletions
|
@ -465,18 +465,19 @@ else
|
|||
_description expl option
|
||||
if [[ -n "$sopts" && -n "$PREFIX" && "$PREFIX" = [-+]${~soptseq}[$sopts] ]]; then
|
||||
if [[ "$PREFIX" = [-+]${~soptseq1} ]]; then
|
||||
compadd "$expl[@]" -Q \
|
||||
compadd "$expl[@]" -Q -M 'r:|_=* r:|=*' \
|
||||
-y "( ${(j: :)${(@M)${(@k)opts}:#[-+]?}} ${(j: :)${(@M)${(@k)dopts}:#[-+]?}} ${(j: :)${(@M)${(@k)odopts}:#[-+]?}} )" - \
|
||||
"${PREFIX}${(@k)^opts[(I)${PREFIX[1]}?]#?}" \
|
||||
"${PREFIX}${(@k)^dopts[(I)${PREFIX[1]}?]#?}" \
|
||||
"${PREFIX}${(@k)^odopts[(I)${PREFIX[1]}?]#?}" && ret=0
|
||||
else
|
||||
# The last option takes an argument in next word.
|
||||
compadd "$expl[@]" -Q - "${PREFIX}" && ret=0
|
||||
# The last option takes an argument in the next word.
|
||||
compadd "$expl[@]" -Q -M 'r:|_=* r:|=*' - "${PREFIX}" && ret=0
|
||||
fi
|
||||
else
|
||||
compadd "$expl[@]" -Q - "${(@k)opts}" "${(@k)odopts}" && ret=0
|
||||
compadd "$expl[@]" -QS '' - "${(@k)dopts}" && ret=0
|
||||
compadd "$expl[@]" -Q -M 'r:|_=* r:|=*' - \
|
||||
"${(@k)opts}" "${(@k)odopts}" && ret=0
|
||||
compadd "$expl[@]" -QS '' -M 'r:|_=* r:|=*' - "${(@k)dopts}" && ret=0
|
||||
fi
|
||||
fi
|
||||
[[ $#long -ne 0 &&
|
||||
|
@ -530,7 +531,7 @@ else
|
|||
|
||||
_description expl "$descr"
|
||||
|
||||
if [[ -z "$action" ]]; then
|
||||
if [[ "$action" = \ # ]]; then
|
||||
|
||||
# An empty action means that we should just display a message.
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#compdef pbmtext
|
||||
|
||||
_arguments '-font:font file:_files -g *.(#i)pbm' '*:text:'
|
||||
_arguments '-font:font file:_files -g \*.\(\#i\)pbm' '*:text:'
|
||||
|
|
|
@ -7,5 +7,5 @@ _arguments '-s:design size:' '-C:coding scheme:' '-F:font family:' \
|
|||
'-W:width:' '-H:height:' '-D:depth:' '-I:italic correction:' \
|
||||
'-h:horizontal escapement:' '-v:vertical escapement:' \
|
||||
'-x:x offset:' '-y:y offset:' \
|
||||
':pk file:_files -g *.(#i)pk' ':tfm file:_files -g *.(#i)tfm' \
|
||||
':pk file:_files -g \*.\(\#i\)pk' ':tfm file:_files -g \*.\(\#i\)tfm' \
|
||||
'*:file: _pbm_file'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#compdef pktopbm
|
||||
|
||||
_arguments ':pk file:_files -g *.(#i)pk' '-c:character number:' \
|
||||
_arguments ':pk file:_files -g \*.\(\#i\)pk' '-c:character number:' \
|
||||
'*:file: _pbm_file'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#compdef pnmcomp
|
||||
|
||||
_arguments '-invert' '-xoff:x offset:' '-yoff:y offset:' \
|
||||
'-alpha:alpha mask file:_files -g *.(#i)pgm' \
|
||||
'-alpha:alpha mask file:_files -g \*.\(\#i\)pgm' \
|
||||
':overlay file:_pbm_file' '*:file: _pbm_file'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#compdef pnmtoddif
|
||||
|
||||
_arguments '-resolution:horizontal resolution::vertical resolution:' \
|
||||
':file: _pbm_file' ':ddif file:_files -g *.(#i)ddif'
|
||||
':file: _pbm_file' ':ddif file:_files -g \*.\(\#i\)ddif'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#compdef psidtopgm
|
||||
|
||||
_arguments ':width:' ':height:' ':bits per sample:' \
|
||||
':postscript file:_files -g *.(#i)(ps|eps)'
|
||||
':postscript file:_files -g \*.\(\#i\)\(ps\|eps\)'
|
||||
|
|
|
@ -7,4 +7,4 @@ _arguments '-forceplain' '-help' '-landscape' '-portrait' '-nocrop' \
|
|||
'-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)'
|
||||
':postscript file:_files -g \*.\(\#i\)\(ps\|eps\)'
|
||||
|
|
|
@ -21,9 +21,10 @@ elif compset -P '-(symbols|core|command)='; then
|
|||
_files
|
||||
elif [[ "$PREFIX" = -* ]]; then
|
||||
_description expl option
|
||||
compadd "$expl[@]" -QS '' - symbols\= exec\= se\= core\= command\= \
|
||||
directory\= cd\= tty\=
|
||||
compadd "$expl[@]" - help h s e c x d nx n quiet q batch fullname f b
|
||||
compadd "$expl[@]" -QS '' - -symbols\= -exec\= -se\= -core\= -command\= \
|
||||
-directory\= -cd\= -tty\=
|
||||
compadd "$expl[@]" - -help -h -s -e -c -x -d -nx -n -quiet -q -batch \
|
||||
-fullname -f -b
|
||||
else
|
||||
prev="$words[CURRENT-1]"
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ _arguments -s -{a,b,c,D,h,i,l,L,s,T,v,w,x,y,z} \
|
|||
'-I:directory:_dir_list' \
|
||||
'-d-:debug level:' '-k:function names: _exec_funcs -p' \
|
||||
'-m:minimum execution count:' \
|
||||
':executable:_files -g *(*)' \
|
||||
':profile file:_files -g gmon.*' \
|
||||
':executable:_files -g \*\(\*\)' \
|
||||
':profile file:_files -g gmon.\*' \
|
||||
-- -s '(#--[no-] --)' \
|
||||
'*=name*:function name: _exec_funcs' \
|
||||
'*=dirs*:directory:_dir_list'
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
#compdef -P */X11/*
|
||||
|
||||
local expl
|
||||
|
||||
# A simple pattern completion, just as an example.
|
||||
|
||||
if [ "$words[CURRENT-1]" = "-display" ]; then
|
||||
_x_display
|
||||
else
|
||||
_description expl option
|
||||
compadd "$expl[@]" - -display -name -xrm
|
||||
fi
|
||||
_arguments \
|
||||
'-display:display:_x_display' \
|
||||
'-geometry:geometry:_x_geometry' \
|
||||
"$@"
|
||||
|
|
|
@ -1,6 +1,55 @@
|
|||
#compdef xfig
|
||||
|
||||
local expl
|
||||
|
||||
_description expl 'xfig file'
|
||||
_files "$expl[@]" -g '*.fig'
|
||||
_x_options \
|
||||
'-help' \
|
||||
'-Landscape' \
|
||||
'-Portrait' \
|
||||
'-bold:bold font:_x_font' \
|
||||
'-button:button font:_x_font' \
|
||||
'-but_per_row:number of buttons:' \
|
||||
'-cbg:canvas background color:_colors' \
|
||||
'-cfg:canvas foreground color:_colors' \
|
||||
'-debug' \
|
||||
'-depth:visual depth:_x_visdepth' \
|
||||
'-dontswitchcmap' \
|
||||
'-exportlanguage:export language:(box latex epic eepic eepicemu pictex ibmgl eps ps pstex textyl tpic pic mf acad pcx png gif jpeg tiff ppm xbm xpm)' \
|
||||
'-flushleft' \
|
||||
'-iconGeometry:icon geometry:_x_geometry' \
|
||||
'-inches' \
|
||||
'-internalBW:internal border width:' \
|
||||
'-inverse' \
|
||||
'-keyfile:compose key file:_files' \
|
||||
'-latexfonts' \
|
||||
'-left' \
|
||||
'-magnification:magnification factor:' \
|
||||
'-max_image_colors:maximum number of colors:' \
|
||||
'-metric' \
|
||||
'-monochrome' \
|
||||
'-multiple' \
|
||||
'-normal:normal font:_x_font' \
|
||||
'-noscalablefonts' \
|
||||
'-notrack' \
|
||||
'-papersize:output paper size:((Letter\:8.5\"\ x\ 11\" Legal\:8.5\"\ x\ 14\" Ledger\:17\"\ x\ 11\" Tabloid\:11\"\ x\ 17\" A\:8.5\"\ x\ 11\" B\:11\"\ x\ 17\" C\:17\"\ x\ 22\" D\:22\"\ x\ 34\" E\:34\"\ x\ 44\" A4\:21\ cm\ x\ 29.7\ cm A3\:29.7\ cm\ x\ 42\ cm A2\:42\ cm\ x\ 59.4\ cm A1\:59.4\ cm\ x\ 84.1\ cm A0\:84.1\ cm\ x\ 118.9\ cm B%\:18.2\ cm\ x\ 25.7\ cm))' \
|
||||
'-pheight:canvas height:' \
|
||||
'-pwidth:canvas width:' \
|
||||
'-right' \
|
||||
'-scalablefonts' \
|
||||
'-showallbuttons' \
|
||||
'-single' \
|
||||
'-specialtext' \
|
||||
'-spellcheckcommand:program: _command_names -e' \
|
||||
'-startfillstyle:fill style (-1 to 21):' \
|
||||
'-startfontsize:font size (in points):' \
|
||||
'-startgridmode:grid mode:((0\:no\ grid 1\:1/4\ inch\ or\ 5\ mm 2\:1/2\ inch\ or\ 1\ cm 3\:1\ inch\ or\ 2\ cm))' \
|
||||
'-startlatexfont:latex font:' \
|
||||
'-startlinewidth:line width:' \
|
||||
'-startposnmode:positioning mode:((0\:any 1\:1/16\ inch\ or\ 1\ mm 2\:1/4\ inch\ or\ 5\ mm 3\:1/2\ inch\ or\ 1\ cm 4\:1\ inch\ or\ 2\ cm))' \
|
||||
'-startpsfont:postscript font:' \
|
||||
'-starttextstep:text step:' \
|
||||
'-tablet' \
|
||||
'-track' \
|
||||
'-userscale:scale factor:' \
|
||||
'-userunit:unit string:' \
|
||||
'-visual:visual:(TrueColor StaticColor DirectColor StaticGray GrayScale PseudoColor)' \
|
||||
'-zoom:zoom scale:' \
|
||||
'*:xfig file:_files -g \*.\(\#i\)\(\|x\)fig'
|
||||
|
|
|
@ -1,22 +1,16 @@
|
|||
#compdef xsetroot
|
||||
|
||||
local expl
|
||||
|
||||
case "$words[CURRENT-1]" in
|
||||
-cursor_name) _cursors; return;;
|
||||
-([fb]g|solid)) _colors; return;;
|
||||
-cursor) _description expl 'cursor file'
|
||||
_files "$expl[@]" -/g '*.(#i)(xbm|curs(|or))'; return;;
|
||||
-bitmap) _description expl 'bitmap file'
|
||||
_files "$expl[@]" -/g '*.(#i)xbm'; return;;
|
||||
esac
|
||||
|
||||
if [[ CURRENT -gt 2 && "$words[CURRENT-2]" = -cursor ]]; then
|
||||
_description expl 'cursor mask file'
|
||||
_files "$expl[@]" -/g '*.(#i)(xbm|curs(|or)|mask)'
|
||||
else
|
||||
_description expl option
|
||||
compadd "$expl[@]" -M 'm:-=_ r:|_=*' - \
|
||||
-help -def -cursor -cursor_name -bitmap -mod -gray -grey \
|
||||
-fg -bg -rv -solid -name
|
||||
fi
|
||||
_x_options \
|
||||
'-help' \
|
||||
'-def' \
|
||||
'-cursor:cursor file:_files -g \*.\(\#i\)\(xbm\|curs\(\|or\)\):mask file:_files -g \*.\(\#i\)\(xbm\|curs\(\|or\)\|mask\)' \
|
||||
'-cursor_name:cursor name:_cursors' \
|
||||
'-bitmap:bitmap file:_files -g \*.\(\#i\)xbm' \
|
||||
'-mod:x grid distance (1-16): :y grid distance (1-16):' \
|
||||
'-gray' \
|
||||
'-grey' \
|
||||
'-fg:foreground color:_colors' \
|
||||
'-bg:background color:_colors' \
|
||||
'-rv' \
|
||||
'-solid:screen solid color:_colors' \
|
||||
'-name:root window name:'
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#autoload
|
||||
|
||||
_message 'border width'
|
||||
if (( $# )); then
|
||||
_message "$2"
|
||||
else
|
||||
_message 'border width'
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#autoload
|
||||
|
||||
_message 'geometry'
|
||||
if (( $# )); then
|
||||
_message "$2"
|
||||
else
|
||||
_message 'geometry'
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#autoload
|
||||
|
||||
_message 'locale'
|
||||
if (( $# )); then
|
||||
_message "$2"
|
||||
else
|
||||
_message 'locale'
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#autoload
|
||||
|
||||
_message 'name'
|
||||
if (( $# )); then
|
||||
_message "$2"
|
||||
else
|
||||
_message 'name'
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#autoload
|
||||
|
||||
_message 'resource'
|
||||
if (( $# )); then
|
||||
_message "$2"
|
||||
else
|
||||
_message 'resource'
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#autoload
|
||||
|
||||
_message 'selection timeout'
|
||||
if (( $# )); then
|
||||
_message "$2"
|
||||
else
|
||||
_message 'selection timeout'
|
||||
fi
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
#autoload
|
||||
|
||||
_message 'title'
|
||||
if (( $# )); then
|
||||
_message "$2"
|
||||
else
|
||||
_message 'title'
|
||||
fi
|
||||
|
|
99
Completion/X/_xv
Normal file
99
Completion/X/_xv
Normal file
|
@ -0,0 +1,99 @@
|
|||
#compdef xv
|
||||
|
||||
_x_options \
|
||||
'-help' \
|
||||
'-fg:foreground color:_colors' \
|
||||
'-bg:background color:_colors' \
|
||||
'-hi:top left shadow color:_colors' \
|
||||
'-lo:bottom right shadow color:_colors' \
|
||||
'-bw:border width:' \
|
||||
'-geometry:geometry:_x_geometry' \
|
||||
'-fixed' '+fixed' \
|
||||
'-expand:expansion factor:' \
|
||||
'-aspect:aspect ratio (e.g. 4:3):' \
|
||||
'-ncols:maximum number of colors used:' \
|
||||
'-rw' '+rw' \
|
||||
'-perfect' '+perfect' \
|
||||
'-owncmap' '+owncmap' \
|
||||
'-stdcmap' '+stdcmap' \
|
||||
'-cecmap' '+cecmap' \
|
||||
'-ninstall' '+ninstall' \
|
||||
'-8' '+8' \
|
||||
'-24' '+24' \
|
||||
'-quick24' \
|
||||
'-slow24' \
|
||||
'-best24' \
|
||||
'-noqcheck' \
|
||||
'-root' '+root' \
|
||||
'-rmode:root display mode:((0\:tiling 1\:integer\ tiling 2\:mirrored\ tiling 3\:integer\ mirrored\ tiling 4\:centered\ tiling 5\:centered\ tiling\ on\ solid\ background 6\:centered\ tiling\ on\ '"'"'warp'"'"'\ background 7\:centered\ tiling\ on\ '"'"'brick'"'"'\ background 8\:symmetrical\ tiling 9\:symmetrical\ mirrored\ tiling))' \
|
||||
'-noresetroot' '+noresetroot' \
|
||||
'-rfg:root foreground color:_colors' \
|
||||
'-rbg:root background color:_colors' \
|
||||
'-max' '+max' \
|
||||
'-maxpect' '+maxpect' \
|
||||
'-quit' '+quit' \
|
||||
'-clear' '+clear' \
|
||||
'-cmap' '+cmap' \
|
||||
'-cgeom:control window geometry:_x_geometry' \
|
||||
'-imap' '+imap' \
|
||||
'-igeom:info window geometry:_x_geometry' \
|
||||
'-cemap' '+cemap' \
|
||||
'-cegeom:color editor window geometry:_x_geometry' \
|
||||
'-cmtmap' '+cmtmap' \
|
||||
'-cmtgeometry:comments window geometry:_x_geometry' \
|
||||
'-tgeometry:text view window geometry:_x_geometry' \
|
||||
'-vsmap' '+vsmap' \
|
||||
'-vsgeometry:visual schauzer geometry:_x_geometry' \
|
||||
'-nopos' '+nopos' \
|
||||
'-dither' '+dither' \
|
||||
'-smooth' '+smooth' \
|
||||
'-raw' '+raw' \
|
||||
'-crop:left border: :top border: :width: :height:' \
|
||||
'-acrop' '+acrop' \
|
||||
'-4x3' '+4x3' \
|
||||
'-hflip' '+hflip' \
|
||||
'-vflip' '+vflip' \
|
||||
'-rotate:rotation angle:(0 90 -90 +90 180 -180 +180 270 -270 +270)' \
|
||||
'-norm' '+norm' \
|
||||
'-hist' '+hist' \
|
||||
'-gamma:gamma value:' \
|
||||
'-cgamma:red gamma value: :green gamma value: :blue gamma value:' \
|
||||
'-preset:default preset (1-4):(1 2 3 4)' \
|
||||
'-mono' '+mono' \
|
||||
'-rv' '+rv' \
|
||||
'-white:'"'"'white'"'"' color:_colors' \
|
||||
'-black:'"'"'black'"'"' color:_colors' \
|
||||
'-wait:seconds to wait:' \
|
||||
'-wloop' '+wloop' \
|
||||
'-random' '+random' \
|
||||
'-loadclear' '+loadclear' \
|
||||
'-nofreecols' '+nofreecols' \
|
||||
'-rgb' '+rgb' \
|
||||
'-hsv' '+hsv' \
|
||||
'-lbrowse' '+lbrowse' \
|
||||
'-nostat' '+nostat' \
|
||||
'-visual:visual:(TrueColor StaticColor DirectColor StaticGray GrayScale PseudoColor)' \
|
||||
'-cursor:cursor character number:' \
|
||||
'-2xlimit' '+2xlimit' \
|
||||
'-nolimits' '+nolimits' \
|
||||
'-close' '+close' \
|
||||
'-iconic' '+iconic' \
|
||||
'-icgeometry:icon geometry:_x_geometry' \
|
||||
'-dir:directory:_files -/' \
|
||||
'-flist:file list file:_files' \
|
||||
'-drift:x movement correction: :y movement correction:' \
|
||||
'-pkludge' \
|
||||
'-mfn:mono spaced font:_x_font' \
|
||||
'-name:window name:_x_name' \
|
||||
'-viewonly' '+viewonly' \
|
||||
'-grabdelay:grab delay (seconds):' '+grabdelay:grab delay (seconds):' \
|
||||
'-poll' '+poll' \
|
||||
'-vsperfect' '+vsperfect' \
|
||||
'-vsdisable' '+vsdisable' \
|
||||
'-gsdev:ghostscript device:' \
|
||||
'-gsres:ghostscript resolution:' \
|
||||
'-gsgeom:ghostscript page size:' \
|
||||
'-nodecor' '+nodecor' \
|
||||
'-RM' \
|
||||
'-DEBUG:debug level:' \
|
||||
'*:picture file:_files -g \*.\(\#i\)\(gif\|jpeg\|tiff\|pbm\|pgm\|ppm\|xbm\|xpm\|ras\(\|t\)\|tga\|rle\|rgb\|bmp\|pcx\|fits\|pm\)'
|
Loading…
Reference in a new issue