diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-15 12:01:46 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-15 12:01:46 +0000 |
commit | 35b2633ad941966f5fca07b625a594a5b68c0fdb (patch) | |
tree | b54740d014e594ba5d81931cdcdb3387bcf9dfca /Completion/User/_yp | |
parent | bb98460a01ce1f6c1e71f7e401f782c81b71486b (diff) | |
download | zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.gz zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.xz zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.zip |
manual/8639
Diffstat (limited to 'Completion/User/_yp')
-rw-r--r-- | Completion/User/_yp | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/Completion/User/_yp b/Completion/User/_yp index d0876f6dd..1e86bf278 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 context line state ret=1 +local curcontext="$curcontext" line state ret=1 typeset -A opt_args if (( ! $+_yp_cache_maps )); then @@ -16,17 +16,17 @@ fi case "$words[1]" in ypcat) - _arguments -s "$_yp_args[@]" ':map name:->map' && ret=0 + _arguments -C -s "$_yp_args[@]" ':map name:->map' && ret=0 ;; ypmatch) - _arguments -s "$_yp_args[@]" '*::key map:->keymap' && ret=0 + _arguments -C -s "$_yp_args[@]" '*::key map:->keymap' && ret=0 ;; yppasswd) _users return ;; ypwhich) - _arguments \ + _arguments -C \ '(-x)-d[specify domain]:domain name:' \ '(-x -V2 -m -t)-V1[identify version 1 servers]' \ '(-x -V1 -m -t)-V2[identify version 2 servers]' \ @@ -36,7 +36,7 @@ ypwhich) ':host:_hosts' && ret=0 ;; ypset) - _arguments \ + _arguments -C \ '(-V2)-V1[bind version 1 servers]' \ '(-V1)-V2[bind version 2 servers]' \ '-d[specify domain]:domain name:' \ @@ -44,30 +44,30 @@ ypset) ':server:_hosts' && ret=0 ;; ypserv) - _arguments \ + _arguments -C \ '-a[specify database routines]:database routines:((b\:btree d\:dbm/ndbm h\:hash))' && ret=0 ;; ypbind) - _arguments \ + _arguments -C \ '-s[allow secure mode for ypbind]' \ '-S[set domain and servers]:domain:->servers' \ '(-ypsetme)-ypset[accept all ypset requests]' \ '(-ypset)-ypsetme[accept only local ypset requests]' && ret=0 ;; yppush) - _arguments \ + _arguments -C \ '-d[specify domain]:domain name:' \ '-v[print messages]' \ ':map name:->map' && ret=0 ;; yppoll) - _arguments \ + _arguments -C \ '-d[specify domain]:domain name:' \ '-h[specify host]:ask server on host:_hosts' \ ':map name:->map' && ret=0 ;; ypxfr) - _arguments \ + _arguments -C \ '-a[specify database routines]:database routines:((b\:btree d\:dbm/ndbm h\:hash))' \ '-f[force transfer]' \ '-c[don'"'"'t clear current map]' \ @@ -88,30 +88,22 @@ if [[ "$state" = map* ]]; then local expl if [[ $+opt_args[-t] -eq 0 && "$state" != maponly ]]; then - _tags "$context" maps nicknames + _tags maps nicknames else - _tags "$context" maps + _tags 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 + # The `-M ...' allows `pa.n<TAB>' to complete to `passwd.byname'. + _requested maps expl 'map name' && + compadd "$expl[@]" -M 'l:.|by=by l:.|=by r:|.=* r:|=*' - \ + "$_yp_cache_maps[@]" && ret=0 + _requested nicknames expl nicknames && + compadd "$expl[@]" - "$_yp_cache_nicks[@]" && ret=0 done elif [[ "$state" = servers ]]; then if compset -P '*,'; then - if _tags "$context" hosts; then - _description expl 'server' - _hosts -qS, && ret=0 - fi + _wanted hosts expl server && _hosts -qS, && ret=0 else _message 'domain name' fi |