about summary refs log tree commit diff
path: root/Completion/Unix/Type/_printers
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2004-02-18 12:45:24 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2004-02-18 12:45:24 +0000
commita2638f9d57514116b85649bd78c38b57815382ee (patch)
treedc2903561f367ef5686cdb4e244c0d86f28f2396 /Completion/Unix/Type/_printers
parent460e417caa50ecb7906b2cd3419c2a3c4588dd2e (diff)
downloadzsh-a2638f9d57514116b85649bd78c38b57815382ee.tar.gz
zsh-a2638f9d57514116b85649bd78c38b57815382ee.tar.xz
zsh-a2638f9d57514116b85649bd78c38b57815382ee.zip
19436: complete more things from nis
Diffstat (limited to 'Completion/Unix/Type/_printers')
-rw-r--r--Completion/Unix/Type/_printers8
1 files changed, 7 insertions, 1 deletions
diff --git a/Completion/Unix/Type/_printers b/Completion/Unix/Type/_printers
index d736dd51d..02196daee 100644
--- a/Completion/Unix/Type/_printers
+++ b/Completion/Unix/Type/_printers
@@ -1,6 +1,6 @@
 #compdef -value-,PRINTER,-default- -value-,LPDEST,-default-
 
-local expl ret=1 list disp sep
+local expl ret=1 list disp sep tmp
 
 if (( $+commands[lsallq] )); then
   # Use AIX's command to list print queues
@@ -39,6 +39,12 @@ if (( ! $+_lp_cache )); then
       fi
     done < $file[1]
   fi
+
+  if [[ $OSTYPE = solaris* ]] && (( ${+commands[ypcat]} )) &&
+      tmp=$(_call_program printers ypcat printers.conf.byname 2>/dev/null); then
+    _lp_cache+=( ${${${(S)${(f)tmp}/(#b):*((#e)|description=([^:]#):)*/:${match[2]}|}%%|*}:#_default*} ) # If you use YP
+  fi
+
   (( $#_lp_cache )) || _lp_cache=( 'lp0:Guessed default printer' )
   (( $#_lp_alias_cache )) || unset _lp_alias_cache
 fi