about summary refs log tree commit diff
path: root/Completion/Unix/Type/_groups
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/_groups
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/_groups')
-rw-r--r--Completion/Unix/Type/_groups11
1 files changed, 7 insertions, 4 deletions
diff --git a/Completion/Unix/Type/_groups b/Completion/Unix/Type/_groups
index bbb80868b..b6d599c28 100644
--- a/Completion/Unix/Type/_groups
+++ b/Completion/Unix/Type/_groups
@@ -6,11 +6,14 @@ _tags groups || return 1
 
 if ! zstyle -a ":completion:${curcontext}:" groups groups; then
   (( $+_cache_groups )) ||
-      if (( ${+commands[ypcat]} )) &&
-	  tmp=$(_call_program groups ypcat group.byname 2>/dev/null); then
-        : ${(A)_cache_groups:=${${(f)tmp}%%:*}} # If you use YP
+      if (( ${+commands[getent]} )); then
+        : ${(A)_cache_groups:=${${(s: :)$(_call_program groups getent group 2>/dev/null)}%%:*}}
       else
-        : ${(A)_cache_groups:=${${(s: :)$(</etc/group)}%%:*}}
+        : ${(A)_cache_groups:=${${${(s: :)$(</etc/group)}%%:*}:#+}}
+	if (( ${+commands[ypcat]} )) &&
+	    tmp=$(_call_program groups ypcat group.byname 2>/dev/null); then
+          _cache_groups+=( ${${(f)tmp}%%:*} ) # If you use YP
+	fi
       fi
 
   groups=( "$_cache_groups[@]" )