about summary refs log tree commit diff
path: root/Completion/User/_ports
blob: 8cf90a913ea8b2c361dd6543cfa49a65e8bf2325 (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 ports; then
  (( $+_cache_ports )) ||
      : ${(A)_cache_ports:=${${(M)${${(f)"$(</etc/services)"}:#\#*}#*/tcp}%%[ 	]*}}

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

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