1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-12-29 16:25:35 +01:00

Merge of users/12154 by Ryan F: MacOS X group completion.

This commit is contained in:
Paul Ackersviller 2007-11-29 02:28:06 +00:00
parent f2f4725b8e
commit 67ed8932af

View file

@ -7,7 +7,11 @@ _tags groups || return 1
if ! zstyle -a ":completion:${curcontext}:" groups groups; then
(( $+_cache_groups )) ||
if [[ $OSTYPE = darwin* ]]; then
: ${(A)_cache_groups:=${${(M)${(f)"$(_call_program groups lookupd -q group)"}:#name*}##*: }}
if (( ${+commands[lookupd]} )); then
: ${(A)_cache_groups:=${${(M)${(f)"$(_call_program groups lookupd -q group)"}:#name*}##*: }}
elif (( ${+commands[dscacheutil]} )); then
: ${(A)_cache_groups:=${${(M)${(f)"$(_call_program groups dscacheutil -q group)"}:#name*}##*: }}
fi
elif (( ${+commands[getent]} )); then
: ${(A)_cache_groups:=${${(s: :)$(_call_program groups getent group 2>/dev/null)}%%:*}}
else