about summary refs log tree commit diff
path: root/Completion/Unix/Type/_hosts
blob: a058b28da8a9f078559db67a1a179c6db16d0bc5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#compdef ftp ping rwho rup xping traceroute host aaaa zone mx ns soa txt

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