about summary refs log tree commit diff
path: root/Completion/User/_ports
blob: db4ea03c8aecd43dd1b69987d94cdfa4eede78e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#autoload

local expl ports

if ! _style -a ports ports ports; then
  (( $+_cache_ports )) ||
      : ${(A)_cache_ports:=${${(M)${${(f)"$(</etc/services)"}:#\#*}#*/tcp}%%[ 	]*}}

  ports=( "$_cache_ports[@]" )
fi

_wanted ports expl port && compadd "$@" "$expl[@]" - "$ports[@]"