diff options
author | Frank Terbeck <ft@bewatermyfriend.org> | 2011-06-02 10:50:35 +0200 |
---|---|---|
committer | Frank Terbeck <ft@bewatermyfriend.org> | 2011-06-02 10:50:35 +0200 |
commit | 2438a0e95aa448f0aeda468752444306b44fe7d0 (patch) | |
tree | 8477e9c6af360f6a89af13e8cb5f2a4f9c1cff2c /Completion/BSD/Command | |
parent | b495ba1e5a3ab1396844490ad8cad17dec23d6c1 (diff) | |
parent | 21266db1d9ae433bf1dcb196a4e258c00541b599 (diff) | |
download | zsh-2438a0e95aa448f0aeda468752444306b44fe7d0.tar.gz zsh-2438a0e95aa448f0aeda468752444306b44fe7d0.zip |
Merge commit 'zsh-4.3.12' into debian
Diffstat (limited to 'Completion/BSD/Command')
-rw-r--r-- | Completion/BSD/Command/.distfiles | 1 | ||||
-rw-r--r-- | Completion/BSD/Command/_bsd_pkg | 2 | ||||
-rw-r--r-- | Completion/BSD/Command/_sockstat | 23 |
3 files changed, 25 insertions, 1 deletions
diff --git a/Completion/BSD/Command/.distfiles b/Completion/BSD/Command/.distfiles index 86530b8ea..d08edf814 100644 --- a/Completion/BSD/Command/.distfiles +++ b/Completion/BSD/Command/.distfiles @@ -15,4 +15,5 @@ _portmaster _portsnap _powerd _procstat +_sockstat ' diff --git a/Completion/BSD/Command/_bsd_pkg b/Completion/BSD/Command/_bsd_pkg index 8cc1a6230..9f4b0f11a 100644 --- a/Completion/BSD/Command/_bsd_pkg +++ b/Completion/BSD/Command/_bsd_pkg @@ -178,7 +178,7 @@ _bsd_pkg() { '-m[show mtree files]' '-p[show installation prefixes]' '-q[be quiet]' - '-R[show list list of installed requiring packages]' + '-R[show list of installed requiring packages]' '-r[show requirements scripts]' '-v[be verbose]' ) diff --git a/Completion/BSD/Command/_sockstat b/Completion/BSD/Command/_sockstat new file mode 100644 index 000000000..2acbe6bec --- /dev/null +++ b/Completion/BSD/Command/_sockstat @@ -0,0 +1,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))' |