mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-03 10:21:46 +02:00
zsh-workers/9274
This commit is contained in:
parent
56d0011bb1
commit
bf0bb55f4a
1 changed files with 22 additions and 4 deletions
|
@ -46,12 +46,30 @@ xev)
|
|||
'-rv'
|
||||
;;
|
||||
xhost)
|
||||
local expl type ret=1
|
||||
local expl type ret=1 tmp
|
||||
|
||||
if compset -P '-'; then
|
||||
_wanted displays expl 'disallow access' &&
|
||||
compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \
|
||||
"${${(@M)${(@f)$(xhost)}[2,-1]:#LOCAL:*}#INET:}"
|
||||
tmp=(${(f)"$(xhost)"})
|
||||
shift tmp
|
||||
tmp=(${tmp:#LOCAL:|<*>})
|
||||
if [[ "$tmp" = *:* ]]; then
|
||||
if compset -P '(#b)(*):'; then
|
||||
type="$match[1]"
|
||||
_wanted displays expl 'disallow access' &&
|
||||
{
|
||||
compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \
|
||||
${${(M)tmp:#(#i)$type:*}#(#i)$type:} ||
|
||||
_hosts "$expl[@]"
|
||||
}
|
||||
else
|
||||
_alternative \
|
||||
'types:name family:compadd -S: ${(L)tmp%%:*}' \
|
||||
'hosts:host:compadd ${(@)tmp#*:}' && ret=0
|
||||
fi
|
||||
else
|
||||
_wanted displays expl 'disallow access' &&
|
||||
{ compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp || _hosts "$expl[@]" }
|
||||
fi
|
||||
else
|
||||
compset -P +
|
||||
|
||||
|
|
Loading…
Reference in a new issue