From 8e5365152aa58bb0d8a209efe176e1e7ae70675f Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 31 Aug 1999 10:23:46 +0000 Subject: manual/7562 --- Completion/X/_x_color | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Completion/X/_x_color (limited to 'Completion/X/_x_color') diff --git a/Completion/X/_x_color b/Completion/X/_x_color new file mode 100644 index 000000000..346142eea --- /dev/null +++ b/Completion/X/_x_color @@ -0,0 +1,24 @@ +#autoload + +local expl + +if (( ! $+_color_cache )); then + local file + + # Cache of color names doesn't exist yet, create it. + + file=( /usr/{lib,{{X11R6,openwin},local{,/X11{,R6}}}/lib}/X11/rgb.txt(N) ) + + if (( $#file )); then + _color_cache=( "${(@)${(@f)$(< $file[1])}[2,-1]##* }" ) + else + + # Stupid default value. + + _color_cache=(white black gray red blue green) + fi +fi + +_description expl 'color specification' +compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} m:-=\ r:|[ A-Z0-9]=* r:|=*' - \ + "$_color_cache[@]" -- cgit 1.4.1