diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-02 11:37:41 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-02 11:37:41 +0000 |
commit | b5b7d62d94e72ac3550c37d3013f5d411e87a625 (patch) | |
tree | ae7ad043a2c96989458135983fac31a8c430202e /Completion/Unix | |
parent | c0a4335219270fdbf03b785fee7ee40c59eff759 (diff) | |
download | zsh-b5b7d62d94e72ac3550c37d3013f5d411e87a625.tar.gz zsh-b5b7d62d94e72ac3550c37d3013f5d411e87a625.tar.xz zsh-b5b7d62d94e72ac3550c37d3013f5d411e87a625.zip |
moved from Completion/User/_groups
Diffstat (limited to 'Completion/Unix')
-rw-r--r-- | Completion/Unix/Type/_groups | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Completion/Unix/Type/_groups b/Completion/Unix/Type/_groups new file mode 100644 index 000000000..a8d8ad068 --- /dev/null +++ b/Completion/Unix/Type/_groups @@ -0,0 +1,19 @@ +#compdef newgrp + +local expl groups tmp + +_tags groups || return 1 + +if ! zstyle -a ":completion:${curcontext}:" groups groups; then + (( $+_cache_groups )) || + if (( ${+commands[ypcat]} )) && + tmp=$(_call_program groups ypcat group.byname 2>/dev/null); then + : ${(A)_cache_groups:=${${(f)tmp}%%:*}} # If you use YP + else + : ${(A)_cache_groups:=${${(s: :)$(</etc/group)}%%:*}} + fi + + groups=( "$_cache_groups[@]" ) +fi + +_wanted groups expl group compadd "$@" -a groups |