summary refs log tree commit diff
path: root/Completion/Solaris/Command/_flowadm
diff options
context:
space:
mode:
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 "$@"