1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 14:04:03 +01:00
zsh/Completion/User/_hosts

14 lines
398 B
Plaintext
Raw Normal View History

#compdef ftp ping rwho rup xping traceroute host lftp
1999-04-15 20:05:38 +02:00
2000-05-31 11:38:25 +02:00
local expl hosts
if ! zstyle -a ":completion:${curcontext}:hosts" hosts hosts; then
(( $+_cache_hosts )) ||
: ${(A)_cache_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}}
hosts=( "$_cache_hosts[@]" )
fi
_wanted hosts expl host \
compadd -M 'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' "$@" -a hosts