mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
zsh-workers/10099
This commit is contained in:
parent
7758948a62
commit
eaa55b5461
2 changed files with 5 additions and 4 deletions
|
@ -4,7 +4,7 @@ local prev="$words[CURRENT-1]"
|
|||
|
||||
if [[ "$prev" = -o ]]; then
|
||||
_tags -C -o options && _options
|
||||
elif [[ "$prev" = -([no]t|ef) ]]; then
|
||||
elif [[ "$prev" = -([a-hkprsuwxLOGSN]|[no]t|ef) ]]; then
|
||||
_tags -C "$prev" files && _files
|
||||
else
|
||||
_alternative 'files:: _files' 'parameters:: _parameters'
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
#compdef newgrp
|
||||
|
||||
local expl groups
|
||||
local expl groups tmp
|
||||
|
||||
_wanted groups expl group || return 1
|
||||
|
||||
if ! zstyle -a ":completion:${curcontext}:" groups groups; then
|
||||
(( $+_cache_groups )) ||
|
||||
if (( ${+commands[ypcat]} )); then
|
||||
: ${(A)_cache_groups:=${${(s: :)$(_call groups ypcat group.byname)}%%:*}} # If you use YP
|
||||
if (( ${+commands[ypcat]} )) &&
|
||||
tmp=$(_call groups ypcat group.byname); then
|
||||
: ${(A)_cache_groups:=${${(f)tmp}%%:*}} # If you use YP
|
||||
else
|
||||
: ${(A)_cache_groups:=${${(s: :)$(</etc/group)}%%:*}}
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue