1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 05:53:52 +01:00
zsh/Completion/User/_groups

20 lines
488 B
Plaintext
Raw Normal View History

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
_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]} )) &&
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