1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 05:53:52 +01:00
zsh/Completion/User/_domains

21 lines
583 B
Plaintext
Raw Normal View History

2000-01-20 19:39:41 +01:00
#autoload
local expl domains tmp
2000-05-31 11:38:25 +02:00
if ! zstyle -a ":completion:${curcontext}:domains" domains domains; then
2000-01-20 19:39:41 +01:00
if (( ! $+_cache_domains )); then
_cache_domains=()
if [[ -f /etc/resolv.conf ]]; then
while read tmp; do
[[ "$tmp" = (domain|search)* ]] &&
_cache_domains=( "$_cache_domains[@]" "${=${tmp%%[ ]#}#*[ ]}" )
done < /etc/resolv.conf
2000-05-31 11:38:25 +02:00
_cache_domains=( "${(@)_cache_domains:#[ ]#}" )
2000-01-20 19:39:41 +01:00
fi
fi
domains=( "$_cache_domains[@]" )
fi
2000-05-31 11:38:25 +02:00
_wanted domains expl domain \
compadd -M 'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' "$@" -a domains