diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-31 09:38:25 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-31 09:38:25 +0000 |
commit | fd25b24df6b4f098944c4994195d3894a27a8208 (patch) | |
tree | 53f7f940844ab34c7349506622fc8241c782f98c /Completion/User/_hosts | |
parent | 4629133ad33dacef459ad9fa5ca438836a1be9fb (diff) | |
download | zsh-fd25b24df6b4f098944c4994195d3894a27a8208.tar.gz zsh-fd25b24df6b4f098944c4994195d3894a27a8208.tar.xz zsh-fd25b24df6b4f098944c4994195d3894a27a8208.zip |
use compadd -[ak] (11549)
Diffstat (limited to 'Completion/User/_hosts')
-rw-r--r-- | Completion/User/_hosts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Completion/User/_hosts b/Completion/User/_hosts index 3acc327ac..30c3b2357 100644 --- a/Completion/User/_hosts +++ b/Completion/User/_hosts @@ -1,3 +1,13 @@ -#defcomp ftp ncftp ping rwho rup xping traceroute nslookup +#compdef ftp ncftp ping rwho rup xping traceroute host -complist -k hosts +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 |