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

local expl ports

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

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

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