remove utf8 garbage
[zfbsd.git] / _sockstat
blob2acbe6bec3513dd076d56a84be59f46711ca42f2
1 #compdef sockstat
3 local tmp_proto protocols proto
5 tmp_proto=(${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}})
6 for proto ($tmp_proto) { 
7         case $proto in
8         *\#*)
9                 protocols=($protocols ${${(j: :)${=proto}}// *\# /:}) 
10                 ;;
11         *)
12                 protocols=($protocols ${${(j: :)${=proto}}// */})
13         esac
16 _arguments -s \
17         '-4[Show AF_INET (IPv4) sockets]' \
18         '-6[Show AF_INET6 (IPv6) sockets]' \
19         '-c[Show connected sockets]' \
20         '-l[Show listening sockets]' \
21         '-u[Show AF_LOCAL (UNIX) sockets]' \
22         '-p[Only show Internet sockets if the port number is on the specified list]' \
23         '-P[Only show sockets of the specified protocols]:protocols:(($protocols))'