diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-11 07:57:56 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-11 07:57:56 +0000 |
commit | fac3086d9782e73dcaf1aa65fd36a0b63a374719 (patch) | |
tree | 7bab35e2787ca17f02ec932dffae1bfff2ffcfe3 /Completion/X/_xutils | |
parent | 37012f06a7e5e8a64614dbf9032c77cff1bcfcfb (diff) | |
download | zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.gz zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.xz zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.zip |
_wanted now tests both tags and labels; change places where _wanted was called without a command; allow multiple patterns per string in file-patterns; update _next_tags to work with labels (10632)
Diffstat (limited to 'Completion/X/_xutils')
-rw-r--r-- | Completion/X/_xutils | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Completion/X/_xutils b/Completion/X/_xutils index a57f7be36..c0d94a998 100644 --- a/Completion/X/_xutils +++ b/Completion/X/_xutils @@ -55,23 +55,29 @@ xhost) if [[ "$tmp" = *:* ]]; then if compset -P '(#b)(*):'; then type="$match[1]" - _wanted displays && - while _next_label displays expl 'disallow access'; do + _tags displays + while _tags; do + while _next_label displays expl 'disallow access'; do { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \ ${${(M)tmp:#(#i)$type:*}#(#i)$type:} || - _hosts "$expl[@]" } && return 0 - done + _hosts "$expl[@]" } && ret=0 + done + (( ret )) || return 0 + done else _alternative \ 'types:name family:compadd -S: ${(L)tmp%%:*}' \ 'hosts:host:compadd ${(@)tmp#*:}' && ret=0 fi else - _wanted displays && - while _next_label displays expl 'disallow access'; do - { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp || - _hosts "$expl[@]" } && return 0 - done + _tags displays + while _tags; do + while _next_label displays expl 'disallow access'; do + { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp || + _hosts "$expl[@]" } && ret=0 + done + (( ret )) || return 0 + done fi else compset -P + |