diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-22 12:29:47 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-22 12:29:47 +0000 |
commit | 3d9d13e918c195f974ff7b2f1dc5b65f6b20a441 (patch) | |
tree | d571aef9c8152287ed94dae1199108de80f0b984 /Completion/User/_hosts | |
parent | a76b36928c5cbeef3fe015ca30bbf910ab2a107e (diff) | |
download | zsh-3d9d13e918c195f974ff7b2f1dc5b65f6b20a441.tar.gz zsh-3d9d13e918c195f974ff7b2f1dc5b65f6b20a441.tar.xz zsh-3d9d13e918c195f974ff7b2f1dc5b65f6b20a441.zip |
zsh-workers/8720
Diffstat (limited to 'Completion/User/_hosts')
-rw-r--r-- | Completion/User/_hosts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Completion/User/_hosts b/Completion/User/_hosts index 83480efe4..196f40c83 100644 --- a/Completion/User/_hosts +++ b/Completion/User/_hosts @@ -1,8 +1,13 @@ #compdef ftp ncftp ping rwho rup xping traceroute host -local expl +local expl hosts -: ${(A)hosts:=${(s: :)${(ps:\t:)${${(f)"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} +if ! _style -a 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:|=*' "$@" "$expl[@]" - "$hosts[@]" |