about summary refs log tree commit diff
path: root/Completion/Solaris
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2017-08-16 23:47:55 +0200
committerOliver Kiddle <opk@zsh.org>2017-08-16 23:47:55 +0200
commitb1a1a342504f8013907244c3a2728571e7839543 (patch)
treea79623410f1702ad218b7a6eda3d3ba414393948 /Completion/Solaris
parentf80fe2dfe9dffc512fe76931879087a3ed6d6fa8 (diff)
downloadzsh-b1a1a342504f8013907244c3a2728571e7839543.tar.gz
zsh-b1a1a342504f8013907244c3a2728571e7839543.tar.xz
zsh-b1a1a342504f8013907244c3a2728571e7839543.zip
41556: complete BPF (libpcap) filters
Diffstat (limited to 'Completion/Solaris')
-rw-r--r--Completion/Solaris/Command/_snoop111
1 files changed, 28 insertions, 83 deletions
diff --git a/Completion/Solaris/Command/_snoop b/Completion/Solaris/Command/_snoop
index f734c2fb1..77798a730 100644
--- a/Completion/Solaris/Command/_snoop
+++ b/Completion/Solaris/Command/_snoop
@@ -1,87 +1,32 @@
 #compdef snoop
 
-_snoop() {
-	local -a t_opt exp
+local -a args
 
-t_opt=(
-	"r"\:"time relative to first packet"
-	"a"\:"absolute time"
-	"d"\:"delta time - time since receiving previous packet"
+[[ $OSTYPE = solaris2.<11-> ]] && args=(
+  '-I+[capture packets from specified interface]:interface:_net_interfaces'
 )
-
-exp=(
-	"ether"
-	"ethertype"
-	"host"
-	"from"
-	"to"
-	"ip"
-	"ip6"
-	"arp"
-	"rarp"
-	"pppoe"
-	"pppoed"
-	"pppoes"
-	"vlan"
-	"vlan-id"
-	"broadcast"
-	"multicast"
-	"bootp"
-	"dhcp"
-	"dhcp6"
-	"apple"
-	"decnet"
-	"greater"
-	"less"
-	"udp"
-	"tcp"
-	"icmp"
-	"icmp6"
-	"ah"
-	"esp"
-	"net"
-	"port"
-	"rpc"
-	"zone"
-	"ldap"
-	"gateway"
-	"nofrag"
-	">"
-	">="
-	"<"
-	"<="
-	"="
-	"!="
-	"and"
-	"or"
-	"not"
-	"slp"
-	"sctp"
-	"ospf"
-)
-
-	_arguments \
-		'-a[generate audio signal on receiving packets]' \
-		'-c[quit after capturing maxcount packets]:maxcount' \
-		'-d[capture packets from specified device]:device:_net_interfaces' \
-		'-i[display packets previously captured to file]:file:_files' \
-		'-n[use file as IP address-to-name mapping table]:file:_files' \
-		'-o[save captured packets to file]:file:_files' \
-		'-p[display one or more packets from captured file]:first packet number [ , last packet number]' \
-		'-q[do not display packet counter when capturing to file]' \
-		'-r[do not resolve IP addresses to names]' \
-		'-s[truncate each packet after snaplen bytes]:snaplen' \
-		'-t[time-stamp presentation]:time-stamp mode:(($t_opt))' \
-		'-C[list code generated from filter expression]' \
-		'-D[display number of packets dropped on the summary line]' \
-		'-N[create IP-address-to-name mapping table file (used with -i)]' \
-		'-I[capture packets from specified interface]:interface:_net_interfaces' \
-		'-P[capture packets in non-promiscuous mode]' \
-		'-S[display size of the entire link layer frame in bytes]' \
-		'-V[verbose summary mode]' \
-		'-v[verbose mode]' \
-		'-x[display offset and length of packet in HEX and ASCII]:offset [ , length]' \
-		'*:expression:(($exp))' \
-}
-
-_snoop "$@"
+_arguments -s -S -A "-*" \
+  '-a[generate audio signal on receiving packets]' \
+  '-c+[quit after capturing specified number of packets]:number of packets' \
+  '-d+[capture packets from specified device]:device:_net_interfaces' \
+  '-i+[display packets previously captured to file]:file:_files' \
+  '-n+[use file as IP address-to-name mapping table]:file:_files' \
+  '-o+[save captured packets to file]:file:_files' \
+  '-p+[display one or more packets from captured file]:first packet number [ , last packet number]' \
+  "-q[don't display packet counter when capturing to file]" \
+  "-r[don't resolve IP addresses to names]" \
+  '-s[truncate each packet after specified number of bytes]:length (bytes)' \
+  '-t+[specify time-stamp presentation]:time-stamp mode:((
+    r\:relative\ to\ first\ packet
+    a\:absolute
+    d\:delta\ -\ since\ previous\ packet
+  ))' \
+  '-C[list code generated from filter expression]' \
+  '-D[display number of packets dropped on the summary line]' \
+  '-N[create IP-address-to-name mapping table file (used with -i)]' \
+  '-P[capture packets in non-promiscuous mode]' \
+  '-S[display size of the entire link layer frame in bytes]' \
+  '-V[verbose summary mode]' \
+  '-v[verbose mode]' \
+  '-x+[display offset and length of packet in HEX and ASCII]:offset [ , length]' \
+  '*::expression:= _bpf_filters'