From 9161505a67dd21ad03d8eb0b79d9a41ae181f4ef Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 25 Mar 2002 16:25:43 +0000 Subject: merge changes from 4.1 --- ChangeLog | 10 +++ Completion/Unix/Command/_zip | 6 +- Completion/X/Command/.distfiles | 2 +- Completion/X/Command/_netscape | 92 ++++++++++++++++++++++ Completion/X/Command/_x_utils | 165 +++++++++++++++++++++++++++++++++++++++ Completion/X/Command/_xfig | 34 ++++++++ Completion/X/Command/_xloadimage | 85 ++++++++++++++++++++ Completion/X/Command/_xv | 45 +++++++++++ Completion/X/Type/.distfiles | 9 +++ 9 files changed, 443 insertions(+), 5 deletions(-) create mode 100644 Completion/X/Command/_netscape create mode 100644 Completion/X/Command/_x_utils create mode 100644 Completion/X/Command/_xfig create mode 100644 Completion/X/Command/_xloadimage create mode 100644 Completion/X/Command/_xv create mode 100644 Completion/X/Type/.distfiles diff --git a/ChangeLog b/ChangeLog index cfb4aa427..2c4d2f6c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2002-03-25 Oliver Kiddle + * users/4561: Completion/Unix/Command/_zip: fix bug with finding + the zipfile's name in the current command-line. + + * 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 + * 16366: Completion/X/Command/_vnc, Completion/Unix/Command/_java, Completion/Unix/Command/_samba: add missing description argument in _values calls diff --git a/Completion/Unix/Command/_zip b/Completion/Unix/Command/_zip index 7d4509e6f..6f83b748f 100644 --- a/Completion/Unix/Command/_zip +++ b/Completion/Unix/Command/_zip @@ -1,6 +1,6 @@ #compdef zip unzip zipinfo -local suffixes suf zipfile izip uzi +local suffixes suf zipfile uzi local expl curcontext="$curcontext" state line typeset -A opt_args @@ -114,9 +114,7 @@ case $state in if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then _files -g '^(#i)*.(zip|[jw]ar)' && return 0 else - (( izip = 1 + words[(I)-[^xi]*] )) - (( izip == 1 )) && (( izip++ )) - zipfile=( $~words[izip](|.zip|.ZIP) ) + zipfile=( $~line[1](|.zip|.ZIP) ) [[ -z $zipfile[1] ]] && return 1 if [[ $zipfile[1] != $_zip_cache_list ]]; then _zip_cache_name="$zipfile[1]" diff --git a/Completion/X/Command/.distfiles b/Completion/X/Command/.distfiles index da4d54381..26bf2aff1 100644 --- a/Completion/X/Command/.distfiles +++ b/Completion/X/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 ' diff --git a/Completion/X/Command/_netscape b/Completion/X/Command/_netscape new file mode 100644 index 000000000..8dd044f9f --- /dev/null +++ b/Completion/X/Command/_netscape @@ -0,0 +1,92 @@ +#compdef netscape + +local curcontext="$curcontext" state line ret=1 suf +typeset -A opt_args + +_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]: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:' \ + '-mono[force 1-bit-deep image display]' \ + '-iconic[start up iconified]' \ + '-remote[execute a command in an existing Netscape]:remote command:->remote' \ + '-id[id of X window to send remote commands to]:window-id:' \ + '-raise[raise window following remote command]' \ + "-noraise[don't raise window following remote command]" \ + '-nethelp[show nethelp]' \ + -{dont-force-window-stacking,no-about-splash} \ + -{,no-}{,irix-}session-management \ + -{done-save,ignore}-geometry-prefs \ + -{component-bar,composer,edit,messenger,mail,discussions,news} \ + '*:location:->urls' && ret=0 + +[[ "$state" = "urls" ]] && + _files "$@" && return 0 + +# Handle netscape remote commands +if [[ "$state" = "remote" ]]; then + local -a remote_commands + remote_commands=(openURL openFile saveAs mailto addBookmark) + + compset -P '*\(' + if compset -S '(|\\)\)*'; then + set - -S "" "$@" + else + set - -S"${${QIPREFIX:+)}:-\)}$compstate[quote] " "$@" + fi + case $IPREFIX in + openURL*|addBookmark*) state=urls;; + openFile*) _files "$@" -W ~;; + saveAs*) + if compset -P "*,"; then + _wanted types expl 'data type' \ + compadd "$@" -M 'm:{a-zA-Z}={A-Za-z}' HTML Text PostScript && ret=0 + else + compset -S ",*" || suf="," + _files -qS "$suf" -W ~ && ret=0 + fi + ;; + mailto*) + compset -P "*," + if compset -P '*@'; then + _wanted hosts expl 'remote host name' _hosts -q -S, && ret=0 + else + compset -S "@*" || suf="@" + _wanted users expl 'login name' _users -q -S "$suf" && ret=0 + fi + ;; + *) + compset -S '(|\\)\(*' || suf="${${QIPREFIX:+(}:-\(}" + _wanted commands expl 'remote commands' \ + compadd -qS "$suf" -M 'm:{a-zA-Z}={A-Za-z}' -a \ + remote_commands && ret=0 + ;; + esac +fi + +if [[ "$state" = "urls" ]]; then + # Complete netscape urls + if compset -P about: ; then + _wanted values expl 'about what' \ + compadd "$@" authors blank cache document fonts global hype image-cache \ + license logo memory-cache mozilla plugins && ret=0 + elif compset -P news: ; then + _newsgroups "$@" && ret=0 + else + _tags prefixes + while _tags; do + while _next_label prefixes expl 'URL prefix' "$@"; do + _urls "$expl[@]" && ret=0 + compset -S '[^:]*' + compadd -S '' "$expl[@]" about: news: mocha: javascript: && ret=0 + done + (( ret )) || return 0 + done + fi +fi + +return ret diff --git a/Completion/X/Command/_x_utils b/Completion/X/Command/_x_utils new file mode 100644 index 000000000..e286dd3b3 --- /dev/null +++ b/Completion/X/Command/_x_utils @@ -0,0 +1,165 @@ +#compdef xdpyinfo xwininfo xkill xfontsel xfd xev xhost xon xsetroot xwd xwud xrdb + +case "$service" in +xdpyinfo) + _x_arguments \ + -queryExtensions \ + '-ext:extension: _x_extension -a' + ;; +xwininfo) + _x_arguments \ + -{help,int,children,tree,stats,bits,events,size,wm,shape,frame,all,english,metric} \ + '(-id -name)-root' \ + '(-id -root)-name:name: _x_window -n' \ + '(-name -root)-id:id: _x_window' + ;; +xkill) + _x_arguments \ + -frame \ + '(-id)-all' \ + '(-all)-id:window: _x_window' \ + '-button:selection button:(any 1 2 3 4 5)' + ;; +xfontsel) + _xt_arguments \ + -{print,noscaled} \ + '-pattern:font pattern:_x_font' \ + '-sample:sample text:' \ + '-sample16:16-bit sample text:' + ;; +xfd) + _xt_arguments \ + '-fn:font: _x_font' \ + -{box,center} \ + '-start:first character number:' \ + '-bc:box border color:_x_color' \ + '-rows:number of rows:' \ + '-columns:number of columns:' + ;; +xev) + _x_arguments \ + '-bw:border width:' \ + '-bs:type of backing store:(NotUseful WhenMapped Always)' \ + '-id:id:_x_window' \ + '-s[use save-under]' \ + '-name:window name:' \ + '-rv' + ;; +xhost) + local expl type ret=1 tmp match + + if compset -P '-'; then + tmp=(${(f)"$(xhost)"}) + shift tmp + tmp=(${tmp:#LOCAL:|<*>}) + if [[ "$tmp" = *:* ]]; then + if compset -P '(#b)(*):'; then + type="$match[1]" + _tags displays + while _tags; do + while _next_label displays expl 'disallow access'; do + { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \ + ${${(M)tmp:#(#i)$type:*}#(#i)$type:} || + _hosts "$expl[@]" } && ret=0 + done + (( ret )) || return 0 + done + else + _alternative \ + 'types:name family:compadd -S: ${(L)tmp%%:*}' \ + 'hosts:host:compadd ${(@)tmp#*:}' && ret=0 + fi + else + _tags displays + while _tags; do + while _next_label displays expl 'disallow access'; do + { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' -a tmp || + _hosts "$expl[@]" } && ret=0 + done + (( ret )) || return 0 + done + fi + else + compset -P + + + if [[ "$PREFIX" = *:* ]]; then + type="${(L)PREFIX%%:*}" + compset -P '*:' + + case "$type" in + inet) _hosts && ret=0;; + dnet) _message 'DECnet host';; + nis) _message 'Secure RPC network name';; + krb) _message 'Kerberos V5 principal';; + esac + else + _alternative \ + 'types:name family:compadd -S: - inet dnet nis krb' \ + 'hosts:: _hosts' && ret=0 + fi + return ret + fi + ;; +xon) + _arguments \ + -{access,debug,nols} \ + '-name:window name:' \ + '-screen:screen number:' \ + '-user:remote user name:_users' \ + ':remote host:_hosts' \ + '(-):command: _command_names -e' \ + '*:command: _normal' + ;; +xsetroot) + _x_arguments \ + -{help,def,gray,grey,rv} \ + '-cursor:cursor file:_files -g \*.\(\#i\)\(xbm\|curs\(\|or\)\):mask file:_files -g \*.\(\#i\)\(xbm\|curs\(\|or\)\|mask\)' \ + '-cursor_name:cursor name:_x_cursor' \ + '-bitmap:bitmap file:_files -g \*.\(\#i\)xbm' \ + '-mod:x grid distance (1-16): :y grid distance (1-16):' \ + '-fg:foreground color:_x_color' \ + '-bg:background color:_x_color' \ + '-solid:screen solid color:_x_color' \ + '-name:root window name:' + ;; +xwd) + _x_arguments \ + -{debug,help,nobdrs,xy,frame,root,icmap,screen,silent} \ + '-out:output file:_files' \ + '-add:pixel change value:' \ + '-id:id: _x_window' \ + '-name:name: _x_window -n' + ;; +xwud) + _x_arguments \ + -{help,new,noclick,raw,rv,scale} \ + '-bg:background color:_x_color' \ + '-fg:foreground color:_x_color' \ + '-in:input file:_files -g \*.\(\#i\)xwd' \ + '-plane:image plane to display:' \ + '-std:standard colormap:(best default gray red blue green)' \ + '-vis:visual:_x_visual' + ;; +xrdb) + _x_arguments \ + -{help,quiet,symbols,retain} \ + '(-all -screen -screens)-global' \ + '(-global -screen -screens)-all' \ + '(-global -all -screens)-screen' \ + '(-global -all -screen)-screens' \ + '-n[only display on stdout]' \ + '(-nocpp)-cpp:preprocessor program:_files -g \*\(-\*\)' \ + '(-cpp)-nocpp' \ + '(-load -override -merge -remove)-query' \ + '(-query -override -merge -remove)-load' \ + '(-query -load -merge -remove)-override' \ + '(-query -load -override -remove)-merge' \ + '(-query -load -override -merge)-remove' \ + '-edit:output file:_files' \ + '-backup:backup extension:' \ + '*-D-:symbol to define:' \ + '*-U-:symbol to undefine:' \ + '*-I-:include directory:_files -/' \ + '*:defaults file:_files' + ;; +esac diff --git a/Completion/X/Command/_xfig b/Completion/X/Command/_xfig new file mode 100644 index 000000000..cc216a7b4 --- /dev/null +++ b/Completion/X/Command/_xfig @@ -0,0 +1,34 @@ +#compdef xfig + +_x_arguments \ + -{help,Landscape,Portrait,debug,dontswitchcmap,flushleft,inches,inverse,latexfonts,left,metric,monochrome,multiple,noscalablefonts,notrack,right,scalablefonts,showallbuttons,single,specialtext,tablet,track} \ + '-bold:bold font:_x_font' \ + '-button:button font:_x_font' \ + '-but_per_row:number of buttons:' \ + '-cbg:canvas background color:_x_color' \ + '-cfg:canvas foreground color:_x_color' \ + '-depth:visual depth:' \ + '-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)' \ + '-iconGeometry:icon geometry:_x_geometry' \ + '-internalBW:internal border width:' \ + '-keyfile:compose key file:_files' \ + '-magnification:magnification factor:' \ + '-max_image_colors:maximum number of colors:' \ + '-normal:normal font:_x_font' \ + '-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:' \ + '-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:' \ + '-userscale:scale factor:' \ + '-userunit:unit string:' \ + '-visual:visual:_x_visual' \ + '-zoom:zoom scale:' \ + '*:xfig file:_files -g \*.\(\#i\)\(\|x\)fig' diff --git a/Completion/X/Command/_xloadimage b/Completion/X/Command/_xloadimage new file mode 100644 index 000000000..132ecbeca --- /dev/null +++ b/Completion/X/Command/_xloadimage @@ -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\:mono g4\:4\ level\ gray g\:gray c\:color))' + ) +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, surrounding 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})'" diff --git a/Completion/X/Command/_xv b/Completion/X/Command/_xv new file mode 100644 index 000000000..1a4523eb6 --- /dev/null +++ b/Completion/X/Command/_xv @@ -0,0 +1,45 @@ +#compdef xv + +_x_arguments \ + -{help,quick24,slow24,best24,noqcheck,pkludge,RM} \ + -+{fixed,rw,perfect,owncmap,stdcmap,cecmap,ninstall,8,24,root,noresetroot,max,maxpect,quit,clear,cmap,imap,cemap,cmtmap,vsmap,nopos,dither,smooth,raw,acrop,4x3,hflip,vflip,norm,hist,mono,rv,wloop,random,loadclear,nofreecols,rgb,hsv,lbrowse,nostat,2xlimit,nolimits,close,iconic,viewonly,poll,vsperfect,vsdisable,nodecor} \ + '-fg:foreground color:_x_color' \ + '-bg:background color:_x_color' \ + '-hi:top left shadow color:_x_color' \ + '-lo:bottom right shadow color:_x_color' \ + '-bw:border width:' \ + '-geometry:geometry:_x_geometry' \ + '-expand:expansion factor:' \ + '-aspect:aspect ratio (e.g. 4:3):' \ + '-ncols:maximum number of colors used:' \ + '-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))' \ + '-rfg:root foreground color:_x_color' \ + '-rbg:root background color:_x_color' \ + '-cgeom:control window geometry:_x_geometry' \ + '-igeom:info window geometry:_x_geometry' \ + '-cegeom:color editor window geometry:_x_geometry' \ + '-cmtgeometry:comments window geometry:_x_geometry' \ + '-tgeometry:text view window geometry:_x_geometry' \ + '-vsgeometry:visual schauzer geometry:_x_geometry' \ + '-crop:left border: :top border: :width: :height:' \ + '-rotate:rotation angle:(0 90 -90 +90 180 -180 +180 270 -270 +270)' \ + '-gamma:gamma value:' \ + '-cgamma:red gamma value: :green gamma value: :blue gamma value:' \ + '-preset:default preset (1-4):(1 2 3 4)' \ + '-white:'"'"'white'"'"' color:_x_color' \ + '-black:'"'"'black'"'"' color:_x_color' \ + '-wait:seconds to wait:' \ + '-visual:visual:_x_visual' \ + '-cursor:cursor character number:' \ + '-icgeometry:icon geometry:_x_geometry' \ + '-dir:directory:_files -/' \ + '-flist:file list file:_files' \ + '-drift:x movement correction: :y movement correction:' \ + '-mfn:mono spaced font:_x_font' \ + '-name:window name:_x_name' \ + '-+grabdelay:grab delay (seconds):' \ + '-gsdev:ghostscript device:' \ + '-gsres:ghostscript resolution:' \ + '-gsgeom:ghostscript page size:' \ + '-DEBUG:debug level:' \ + '*:picture file:_files -g \*.\(\#i\)\(png\|gif\|jpeg\|jpg\|tiff\|tif\|pbm\|pgm\|ppm\|xbm\|xpm\|ras\(\|t\)\|tga\|rle\|rgb\|bmp\|pcx\|fits\|pm\)' diff --git a/Completion/X/Type/.distfiles b/Completion/X/Type/.distfiles new file mode 100644 index 000000000..364e4e6e6 --- /dev/null +++ b/Completion/X/Type/.distfiles @@ -0,0 +1,9 @@ +DISTFILES_SRC=' +.distfiles +_x_borderwidth _x_font _x_resource +_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_visual +' -- cgit 1.4.1