about summary refs log tree commit diff
path: root/Completion/Solaris/Command/_flowadm
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-08-19 19:06:37 +0200
committerOliver Kiddle <opk@zsh.org>2016-08-19 19:06:37 +0200
commit4200466217cb5873061847b069edac959e8027e0 (patch)
tree13839c0ce9b1d00ace07050e58c1e5162bd14b26 /Completion/Solaris/Command/_flowadm
parent580698bc7136454941dd6bbc2ca70f240fabc6b7 (diff)
downloadzsh-4200466217cb5873061847b069edac959e8027e0.tar.gz
zsh-4200466217cb5873061847b069edac959e8027e0.tar.xz
zsh-4200466217cb5873061847b069edac959e8027e0.zip
39071: update completion functions for changes in Solaris 11.3
Diffstat (limited to 'Completion/Solaris/Command/_flowadm')
-rw-r--r--Completion/Solaris/Command/_flowadm48
1 files changed, 16 insertions, 32 deletions
diff --git a/Completion/Solaris/Command/_flowadm b/Completion/Solaris/Command/_flowadm
index 53a9f2210..e4d682ffa 100644
--- a/Completion/Solaris/Command/_flowadm
+++ b/Completion/Solaris/Command/_flowadm
@@ -1,41 +1,18 @@
 #compdef flowadm
-# Synced with the S11U1 build 19 man page
-
-_flowadm() {
 
 local -a subcmds tr props
 local expl
 
 _flowadm_flow(){
-	compadd "$@" - $(flowadm show-flow -p -o flow)
-}
-
-_flowadm_flow_int(){
-	compadd "$@" - $(flowadm show-flow -p -o flow)
-	compadd "$@" - $(dladm show-phys -p -o device)
+  compadd "$@" - $(_call_program flows flowadm show-flow -p -o flow)
 }
 
 subcmds=(
-	"help"
-	"show-flow"
-	"add-flow"
-	"remove-flow"
-	"set-flowprop"
-	"reset-flowprop"
-	"show-flowprop"
-)
-	
-tr=(
-	"tcp"
-	"udp"
-	"sctp"
-	"icmp"
-	"icmpv6"
-)
-
-props=(
-	"maxbw"
+  help show-flow add-flow match-flow remove-flow set-flowprop
+  reset-flowprop show-flowprop
 )
+tr=( tcp udp sctp icmp icmpv6 )
+props=( maxbw )
 
 if [[ $service == "flowadm" ]]; then
 	_arguments -C -A "-*" \
@@ -46,7 +23,7 @@ if [[ $service == "flowadm" ]]; then
 		return
 	fi
 	service="$words[1]"
-	curcontext="${curcontext%:*}=$service:"
+	curcontext="${curcontext%:*}-$service:"
 fi
 case $service in
 
@@ -65,6 +42,16 @@ case $service in
 		':flow:_flowadm_flow' \
 	;;
 
+	(match-flow)
+	_arguments -A "-*" \
+		'-o[specify field to display]:field:(flow link ipaddr proto port dsfield)' \
+		'-p[parsable output]' \
+		'-P[persistent flow property information]' \
+		'-a[specify attribute]:attribute:(local_ip= remote_ip= transport=$tr local_port= dsfield=)' \
+		'(:)-l[display information for link]:link or flow:_net_interfaces' \
+		'(-l):flow:_flowadm_flow' \
+	;;
+
 	("add-flow")
 	_arguments -A "-*" \
 		'-t[temporary changes - do not persist across reboots]' \
@@ -110,6 +97,3 @@ case $service in
 	;;
 
 esac
-}
-
-_flowadm "$@"