summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-20 18:39:41 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-20 18:39:41 +0000
commit0ea326e2b443a7aa25e7eca2a7a5257c07dc7417 (patch)
treeccd2cd26e921e642ce1095ac89e223305f699af5 /Completion
parent2883d92b387a1074189fa7143427f2dfec386b8c (diff)
downloadzsh-0ea326e2b443a7aa25e7eca2a7a5257c07dc7417.tar.gz
zsh-0ea326e2b443a7aa25e7eca2a7a5257c07dc7417.tar.xz
zsh-0ea326e2b443a7aa25e7eca2a7a5257c07dc7417.zip
Initial revision
Diffstat (limited to 'Completion')
-rw-r--r--Completion/User/_domains20
1 files changed, 20 insertions, 0 deletions
diff --git a/Completion/User/_domains b/Completion/User/_domains
new file mode 100644
index 000000000..9bd94a4fd
--- /dev/null
+++ b/Completion/User/_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=( "${(@)_nslookup_domains:#[ 	]#}" )
+    fi
+  fi
+  domains=( "$_cache_domains[@]" )
+fi
+
+_wanted domains expl domain &&
+    compadd -M 'm:{a-zA-Z}={A-Za-z} r:|.=* r:|=*' "$@" "$expl[@]" - "$domains[@]"