diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2007-11-26 23:46:55 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-11-26 23:46:55 +0000 |
commit | 153f942d3e6b7432eda85fef85164c20556d35a3 (patch) | |
tree | 31d5856a691d0ea0323ddeb71cc52728b660bf85 /Completion | |
parent | 8d22b3a4f8551f47fd96eb4e438005ec2a40d7d6 (diff) | |
download | zsh-153f942d3e6b7432eda85fef85164c20556d35a3.tar.gz zsh-153f942d3e6b7432eda85fef85164c20556d35a3.tar.xz zsh-153f942d3e6b7432eda85fef85164c20556d35a3.zip |
Ryan F: users/12154: MacOS X group completion
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Unix/Type/_groups | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Completion/Unix/Type/_groups b/Completion/Unix/Type/_groups index 923c34599..a5624269e 100644 --- a/Completion/Unix/Type/_groups +++ b/Completion/Unix/Type/_groups @@ -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 |