mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-07 11:41:16 +02:00
18 lines
456 B
Text
18 lines
456 B
Text
#compdef newgrp
|
|
|
|
local expl groups
|
|
|
|
_wanted groups expl group || return 1
|
|
|
|
if ! zstyle -a ":completion${curcontext}:groups" groups groups; then
|
|
(( $+_cache_groups )) ||
|
|
if (( ${+commands[ypcat]} )); then
|
|
: ${(A)_cache_groups:=${${(s: :)$(ypcat group.byname)}%%:*}} # If you use YP
|
|
else
|
|
: ${(A)_cache_groups:=${${(s: :)$(</etc/group)}%%:*}}
|
|
fi
|
|
|
|
groups=( "$_cache_groups[@]" )
|
|
fi
|
|
|
|
compadd "$@" "$expl[@]" - "$groups[@]"
|