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

local expl ports

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

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

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