diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-12 15:28:24 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-12 15:28:24 +0000 |
commit | e6282df1155e8d9b08b2e518a452c1997973f1ce (patch) | |
tree | b0c8ed7e8512cc4397ae7df6d138ea66147565b3 /Completion/User/_yp | |
parent | 167b0ae3b98938f75287dcf2e112d41a03532c5f (diff) | |
download | zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.gz zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.xz zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.zip |
manual/8630
Diffstat (limited to 'Completion/User/_yp')
-rw-r--r-- | Completion/User/_yp | 33 |
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 |