1 #compdef newgrp groupdel
5 _tags groups || return 1
7 if ! zstyle -a ":completion:${curcontext}:" groups groups; then
8 (( $+_cache_groups )) ||
9 if [[ $OSTYPE = darwin* ]]; then
10 if (( ${+commands[lookupd]} )); then
11 : ${(A)_cache_groups:=${${(M)${(f)"$(_call_program groups lookupd -q group)"}:#name*}##*: }}
12 elif (( ${+commands[dscacheutil]} )); then
13 : ${(A)_cache_groups:=${${(M)${(f)"$(_call_program groups dscacheutil -q group)"}:#name*}##*: }}
15 elif (( ${+commands[getent]} )); then
16 : ${(A)_cache_groups:=${${(s: :)$(_call_program groups getent group 2>/dev/null)}%%:*}}
18 : ${(A)_cache_groups:=${${${(s: :)$(</etc/group)}%%:*}:#+}}
19 if (( ${+commands[ypcat]} )) &&
20 tmp=$(_call_program groups ypcat group.byname 2>/dev/null); then
21 _cache_groups+=( ${${(f)tmp}%%:*} ) # If you use YP
25 groups=( "$_cache_groups[@]" )
28 _wanted groups expl group compadd -a "$@" - groups