mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-05 23:11:11 +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'
|
'-rv'
|
||||||
;;
|
;;
|
||||||
xhost)
|
xhost)
|
||||||
local expl type ret=1
|
local expl type ret=1 tmp
|
||||||
|
|
||||||
if compset -P '-'; then
|
if compset -P '-'; then
|
||||||
_wanted displays expl 'disallow access' &&
|
tmp=(${(f)"$(xhost)"})
|
||||||
compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \
|
shift tmp
|
||||||
"${${(@M)${(@f)$(xhost)}[2,-1]:#LOCAL:*}#INET:}"
|
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
|
else
|
||||||
compset -P +
|
compset -P +
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue