mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-02 00:41:44 +02:00
moved from Completion/User/_domains
This commit is contained in:
parent
004a5b240d
commit
6e81cd8a16
20
Completion/Unix/Type/_domains
Normal file
20
Completion/Unix/Type/_domains
Normal file
@ -0,0 +1,20 @@
|
||||
#autoload
|
||||
|
||||
local expl domains tmp
|
||||
|
||||
if ! zstyle -a ":completion:${curcontext}:domains" domains domains; then
|
||||
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
|
||||
_cache_domains=( "${(@)_cache_domains:#[ ]#}" )
|
||||
fi
|
||||
fi
|
||||
domains=( "$_cache_domains[@]" )
|
||||
fi
|
||||
|
||||
_wanted domains expl domain \
|
||||
compadd -M 'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' "$@" -a domains
|
Loading…
Reference in New Issue
Block a user