summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 11:38:00 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 11:38:00 +0000
commitec3d67e9b014e27f6dadcfd0999326283a98e3c6 (patch)
tree07c2a1d456f059eda567d554449d6b5053707c9a
parentbd4c30c5bbe75981037f8ab3846aa4a84779bda9 (diff)
downloadzsh-ec3d67e9b014e27f6dadcfd0999326283a98e3c6.tar.gz
zsh-ec3d67e9b014e27f6dadcfd0999326283a98e3c6.tar.xz
zsh-ec3d67e9b014e27f6dadcfd0999326283a98e3c6.zip
moved from Completion/User/_hosts
-rw-r--r--Completion/Unix/Type/_hosts13
1 files changed, 13 insertions, 0 deletions
diff --git a/Completion/Unix/Type/_hosts b/Completion/Unix/Type/_hosts
new file mode 100644
index 000000000..fc2970cb9
--- /dev/null
+++ b/Completion/Unix/Type/_hosts
@@ -0,0 +1,13 @@
+#compdef ftp ping rwho rup xping traceroute host
+
+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