summaryrefslogtreecommitdiffstats
path: root/Completion/User/_yp
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-12 15:28:24 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-12 15:28:24 +0000
commite6282df1155e8d9b08b2e518a452c1997973f1ce (patch)
treeb0c8ed7e8512cc4397ae7df6d138ea66147565b3 /Completion/User/_yp
parentzsh-workers/8617 (diff)
downloadzsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.gz
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.bz2
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.lz
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.xz
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.zst
zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.zip
manual/8630
Diffstat (limited to 'Completion/User/_yp')
-rw-r--r--Completion/User/_yp33
1 files changed, 22 insertions, 11 deletions
diff --git a/Completion/User/_yp b/Completion/User/_yp
index e06f42a29..d0876f6dd 100644
--- a/Completion/User/_yp
+++ b/Completion/User/_yp
@@ -1,6 +1,6 @@
#compdef ypcat ypmatch yppasswd ypwhich ypset ypserv ypbind yppush yppoll ypxfr domainname
-local line state ret=1
+local context line state ret=1
typeset -A opt_args
if (( ! $+_yp_cache_maps )); then
@@ -87,20 +87,31 @@ esac
if [[ "$state" = map* ]]; then
local expl
- _description expl 'map name'
-
- # The `-M ...' allows `pa.n<TAB>' to complete to `passwd.byname'.
-
- compadd "$expl[@]" -M 'l:.|by=by l:.|=by r:|.=* r:|=*' - \
- "$_yp_cache_maps[@]" && ret=0
if [[ $+opt_args[-t] -eq 0 && "$state" != maponly ]]; then
- _description expl 'nicknames'
- compadd "$expl[@]" - "$_yp_cache_nicks[@]" && ret=0
+ _tags "$context" maps nicknames
+ else
+ _tags "$context" maps
fi
+
+ while _tags; do
+ if _requested maps; then
+ # The `-M ...' allows `pa.n<TAB>' to complete to `passwd.byname'.
+
+ _description expl 'map name'
+ compadd "$expl[@]" -M 'l:.|by=by l:.|=by r:|.=* r:|=*' - \
+ "$_yp_cache_maps[@]" && ret=0
+ fi
+ if _requested nicknames; then
+ _description expl 'nicknames'
+ compadd "$expl[@]" - "$_yp_cache_nicks[@]" && ret=0
+ fi
+ done
elif [[ "$state" = servers ]]; then
if compset -P '*,'; then
- _description expl 'server'
- _hosts -qS, && ret=0
+ if _tags "$context" hosts; then
+ _description expl 'server'
+ _hosts -qS, && ret=0
+ fi
else
_message 'domain name'
fi