From 6e81cd8a168c5ba033947ea2464c3c3e7aa794c9 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 2 Apr 2001 11:37:24 +0000 Subject: moved from Completion/User/_domains --- Completion/Unix/Type/_domains | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Completion/Unix/Type/_domains (limited to 'Completion/Unix/Type/_domains') diff --git a/Completion/Unix/Type/_domains b/Completion/Unix/Type/_domains new file mode 100644 index 000000000..42a0966dd --- /dev/null +++ b/Completion/Unix/Type/_domains @@ -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 -- cgit 1.4.1