1999-06-27 07:33:25 +02:00
|
|
|
#compdef newgrp
|
|
|
|
|
2000-04-01 22:43:43 +02:00
|
|
|
local expl groups tmp
|
1999-06-27 07:33:25 +02:00
|
|
|
|
2000-04-11 09:57:56 +02:00
|
|
|
_tags groups || return 1
|
2000-04-01 22:43:43 +02:00
|
|
|
|
|
|
|
if ! zstyle -a ":completion:${curcontext}:" groups groups; then
|
|
|
|
(( $+_cache_groups )) ||
|
|
|
|
if (( ${+commands[ypcat]} )) &&
|
2000-05-11 18:14:58 +02:00
|
|
|
tmp=$(_call groups ypcat group.byname 2>/dev/null); then
|
2000-04-01 22:43:43 +02:00
|
|
|
: ${(A)_cache_groups:=${${(f)tmp}%%:*}} # If you use YP
|
|
|
|
else
|
|
|
|
: ${(A)_cache_groups:=${${(s: :)$(</etc/group)}%%:*}}
|
|
|
|
fi
|
|
|
|
|
|
|
|
groups=( "$_cache_groups[@]" )
|
|
|
|
fi
|
|
|
|
|
2000-05-31 11:38:25 +02:00
|
|
|
_wanted groups expl group compadd "$@" -a groups
|