zsh-workers
 help / color / mirror / code / Atom feed
e61854622cacc9c1e2fa0e3d702839e22a335a82 blob 635 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
#compdef sockstat

local tmp_proto protocols proto

tmp_proto=(${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}})
for proto ($tmp_proto) {
	case $proto in
	*\#*)
		protocols=($protocols ${${(j: :)${=proto}}// *\# /:})
		;;
	*)
		protocols=($protocols ${${(j: :)${=proto}}// */})
	esac
}

_arguments -s \
	'-4[show AF_INET (IPv4) sockets]' \
	'-6[show AF_INET6 (IPv6) sockets]' \
	'-c[show connected sockets]' \
	'-l[show listening sockets]' \
	'-u[show AF_LOCAL (UNIX) sockets]' \
	'-p[only show Internet sockets if the port number is on the specified list]' \
	'-P[only show sockets of the specified protocols]:protocols:(($protocols))'
debug log:

solving e618546 ...
found e618546 in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).