about summary refs log tree commit diff
path: root/Completion/User
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User')
-rw-r--r--Completion/User/_colors14
-rw-r--r--Completion/User/_cursors15
-rw-r--r--Completion/User/_pbm22
-rw-r--r--Completion/User/_x_options7
-rw-r--r--Completion/User/_xsetroot15
5 files changed, 61 insertions, 12 deletions
diff --git a/Completion/User/_colors b/Completion/User/_colors
index 797a7d7b3..7a7b0824b 100644
--- a/Completion/User/_colors
+++ b/Completion/User/_colors
@@ -5,16 +5,10 @@ if (( ! $+_color_cache )); then
 
   # Cache of color names doesn't exist yet, create it.
 
-  for f in /usr/{,local/,X11R6/,openwin/}lib/X11/rgb.txt
-  do
-    if [[ -f $f ]]; then
-      file=$f
-      break;
-    fi
-  done
+  file=( /usr/{lib,{{X11R6,openwin},local{,/X11{,R6}}}/lib}/X11/rgb.txt )
 
-  if [[ -n "$file" ]]; then
-    _color_cache=( "${(@)${(@f)$(< $file)}[2,-1]##*		}" )
+  if (( $#file )); then
+    _color_cache=( "${(@)${(@f)$(< $file[1])}[2,-1]##*		}" )
   else
 
     # Stupid default value.
@@ -23,4 +17,4 @@ if (( ! $+_color_cache )); then
   fi
 fi
 
-compadd - "$_color_cache[@]"
+compadd -M 'm:{a-z}={A-Z} m:-=\  r:|[ A-Z0-9]=* r:|=*' - "$_color_cache[@]"
diff --git a/Completion/User/_cursors b/Completion/User/_cursors
new file mode 100644
index 000000000..7e5cbc44e
--- /dev/null
+++ b/Completion/User/_cursors
@@ -0,0 +1,15 @@
+#autoload
+
+if (( ! $+_cursor_cache )); then
+  local file
+
+  file=( /usr/{include,{{X11R6,openwin},local{,/X11{,R6}}}/include}/X11/cursorfont.h(N) )
+
+  if (( $#file )); then
+    _cursor_cache=( "${(@)${(@)${(M@)${(@f)$(< $file[1])}:#*XC_*}[2,-1]#* XC_}% *}" )
+  else
+    _cursor_cache=( X_cursor )
+  fi
+fi
+
+compadd -M 'm:-=_ r:|_=*' - "$_cursor_cache[@]"
diff --git a/Completion/User/_pbm b/Completion/User/_pbm
index 9bcbef933..931170e80 100644
--- a/Completion/User/_pbm
+++ b/Completion/User/_pbm
@@ -1,4 +1,4 @@
-#compdef -p p[bgpn]m*
+#compdef -p (p[bgpn]m*|*top[bgpn]m)
 
 local pat opts ret=1
 
@@ -51,6 +51,15 @@ if (( ! $+_pbm_options )); then
     pnmtosgi 'imagename'
     pnmtotiff 'predictor rowsperstrip'
     pnmtoxwd 'pseudodepth'
+    asciitopgm 'd'
+    fitstopgm 'image'
+    fitstopnm 'image min max'
+    giftopnm 'image'
+    macptopbm 'extraskip'
+    pstopnm 'llx lly urx ury xborder xmax xsize yborder ymax ysize'
+    rawtopgm 'headerskip rowskip'
+    rawtoppm 'headerskip rowskip'
+    sldtoppm 'height ysize lib Lib scale width xsize'
   )
 
   # Options without arguments.
@@ -99,6 +108,17 @@ if (( ! $+_pbm_options )); then
     pnmtosgi 'verbatim rle'
     pnmtotiff 'none packbits lzw g3 g4 2d fill msb2lsb lsb2msb'
     pnmtoxwd 'directcolor'
+    fitstopnm 'noraw scanmax printmax'
+    g3topbm 'kludge reversebits stretch'
+    giftopnm 'verbose comments'
+    picttoppm 'verbose'
+    pstopnm 'forceplain help landscape portrait nocrop pbm pgm ppm verbose'
+    rawtoppm 'rgb rbg grb gbr brg bgr interpixel interrow'
+    sgitopnm 'verbose'
+    sldtoppm 'adjust dir info verbose'
+    tgatoppm 'debug'
+    tifftopnm 'headerdump'
+    zeisstopnm 'pgm ppm'
   )
 fi
 
diff --git a/Completion/User/_x_options b/Completion/User/_x_options
index cd45c87f6..9c3a303bb 100644
--- a/Completion/User/_x_options
+++ b/Completion/User/_x_options
@@ -2,4 +2,9 @@
 
 # A simple pattern completion, just as an example.
 
-compgen -J options -k '(-display -name -xrm)'
+if [ "$words[CURRENT-1]" = "-display" ]; then
+  _compskip=all
+  _hosts -S ':0 ' -r :
+else
+  compadd -J options - -display -name -xrm
+fi
diff --git a/Completion/User/_xsetroot b/Completion/User/_xsetroot
new file mode 100644
index 000000000..74a0b6180
--- /dev/null
+++ b/Completion/User/_xsetroot
@@ -0,0 +1,15 @@
+#compdef xsetroot
+
+case "$words[CURRENT-1]" in
+-cursor) _files -/g '*.(#i)(xbm|curs(|or))'; return;;
+-cursor_name) _cursors; return;;
+-bitmap) _files -/g '*.(#i)xbm'; return;;
+-([fb]g|solid)) _colors; return;;
+esac
+
+if [[ CURRENT -gt 2 && "$words[CURRENT-2]" = -cursor ]]; then
+  _files -/g '*.(#i)(xbm|curs(|or)|mask)'
+else
+  compadd -M 'm:-=_ r:|_=*' - -help -def -cursor -cursor_name -bitmap -mod -gray -grey \
+                       -fg -bg -rv -solid -name
+fi