components/zsh/Completion/Solaris/Command/_flowadm
changeset 429 02007d525e89
parent 93 b579c7b1bb44
child 904 114a5240af22
equal deleted inserted replaced
428:c1840af5fbf5 429:02007d525e89
     1 #compdef flowadm
     1 #compdef flowadm
       
     2 # Synced with the Nevada build 171 man page
     2 
     3 
     3 _flowadm() {
     4 _flowadm() {
     4 
     5 
     5 local -a subcmds tr props
     6 local -a subcmds tr props
     6 local expl
     7 local expl
    19 	"add-flow"
    20 	"add-flow"
    20 	"remove-flow"
    21 	"remove-flow"
    21 	"set-flowprop"
    22 	"set-flowprop"
    22 	"reset-flowprop"
    23 	"reset-flowprop"
    23 	"show-flowprop"
    24 	"show-flowprop"
    24 	"show-usage"
       
    25 )
    25 )
    26 	
    26 	
    27 tr=(
    27 tr=(
    28 	"tcp"
    28 	"tcp"
    29 	"udp"
    29 	"udp"
    31 	"icmp"
    31 	"icmp"
    32 	"icmpv6"
    32 	"icmpv6"
    33 )
    33 )
    34 
    34 
    35 props=(
    35 props=(
    36 	"priority"
       
    37 	"maxbw"
    36 	"maxbw"
    38 )
    37 )
    39 
    38 
    40 if [[ $service == "flowadm" ]]; then
    39 if [[ $service == "flowadm" ]]; then
    41 	_arguments -C -A "-*" \
    40 	_arguments -C -A "-*" \
    47 	fi
    46 	fi
    48 	service="$words[1]"
    47 	service="$words[1]"
    49 	curcontext="${curcontext%:*}=$service:"
    48 	curcontext="${curcontext%:*}=$service:"
    50 fi
    49 fi
    51 case $service in
    50 case $service in
       
    51 
    52 	("show-flow")
    52 	("show-flow")
    53 	_arguments -A "-*" \
    53 	_arguments -A "-*" \
    54 		'-o[specify field to display]:field:(flow link ipaddr proto port dsfield)' \
    54 		'-o[specify field to display]:field:(flow link ipaddr proto port dsfield)' \
    55 		'-p[parsable output]' \
    55 		'-p[parsable output]' \
    56 		'-P[persistent flow property information]' \
    56 		'-P[persistent flow property information]' \
    57 		'-S[continuously display network utilization by flow]' \
       
    58 		'-s[display flow statistics]' \
       
    59 		'-i[specify interval (used with -s)]:interval' \
       
    60 		- set1 \
    57 		- set1 \
    61 		'-l[display information for link]:link or flow:_net_interfaces' \
    58 		'-l[display information for link]:link or flow:_net_interfaces' \
    62 		- set2 \
    59 		- set2 \
    63 		':flow:_flowadm_flow' \
    60 		':flow:_flowadm_flow' \
    64 	;;
    61 	;;
       
    62 
    65 	("add-flow")
    63 	("add-flow")
    66 	_arguments -A "-*" \
    64 	_arguments -A "-*" \
    67 		'-t[temporary changes - do not persist across reboots]' \
    65 		'-t[temporary changes - do not persist across reboots]' \
    68 		'-R[alternate root dir]:alternate root:_files' \
    66 		'-R[alternate root dir]:alternate root:_files' \
    69 		'-l[specify link to which flow will be added]:link:_net_interfaces' \
    67 		'-l[specify link to which flow will be added]:link:_net_interfaces' \
    70 		'-a[specify attribute]:attribute:(local_ip= remote_ip= transport=$tr local_port= dsfield=)' \
    68 		'-a[specify attribute]:attribute:(local_ip= remote_ip= transport=$tr local_port= dsfield=)' \
    71 		'-p[set property value]:property:(maxbw= priority=)' \
    69 		'-p[set property value]:property:(maxbw=)' \
    72 	;;
    70 	;;
       
    71 
    73 	("remove-flow")
    72 	("remove-flow")
    74 	_arguments -A "-*" \
    73 	_arguments -A "-*" \
    75 		'-t[temporary changes - do not persist across reboots]' \
    74 		'-t[temporary changes - do not persist across reboots]' \
    76 		'-R[alternate root dir]:alternate root:_files' \
    75 		'-R[alternate root dir]:alternate root:_files' \
    77 		- set1 \
    76 		- set1 \
    78 		'-l[specify link from which flow will be deleted]:link:_net_interfaces' \
    77 		'-l[specify link from which flow will be deleted]:link:_net_interfaces' \
    79 		- set2 \
    78 		- set2 \
    80 		':flow:_flowadm_flow' \
    79 		':flow:_flowadm_flow' \
    81 	;;
    80 	;;
       
    81 
    82 	("set-flowprop")
    82 	("set-flowprop")
    83 	_arguments -A "-*" \
    83 	_arguments -A "-*" \
    84 		'-t[temporary changes - do not persist across reboots]' \
    84 		'-t[temporary changes - do not persist across reboots]' \
    85 		'-R[alternate root dir]:alternate root:_files' \
    85 		'-R[alternate root dir]:alternate root:_files' \
    86 		'-p[set property value]:property:(maxbw= priority=)' \
    86 		'-p[set property value]:property:(maxbw=)' \
    87 		':flow:_flowadm_flow' \
    87 		':flow:_flowadm_flow' \
    88 	;;
    88 	;;
       
    89 
    89 	("reset-flowprop")
    90 	("reset-flowprop")
    90 	_arguments -A "-*" \
    91 	_arguments -A "-*" \
    91 		'-t[temporary changes - do not persist across reboots]' \
    92 		'-t[temporary changes - do not persist across reboots]' \
    92 		'-R[alternate root dir]:alternate root:_files' \
    93 		'-R[alternate root dir]:alternate root:_files' \
    93 		'-p[set property value]:property:(maxbw= priority=)' \
    94 		'-p[set property value]:property:(maxbw=)' \
    94 		':flow:_flowadm_flow' \
    95 		':flow:_flowadm_flow' \
    95 	;;
    96 	;;
       
    97 
    96 	("show-flowprop")
    98 	("show-flowprop")
    97 	_arguments -A "-*" \
    99 	_arguments -A "-*" \
    98 		'-c[parsable output (requires -o)]' \
   100 		'-c[parsable output (requires -o)]' \
       
   101 		'-l[specify link whose properties will be shown]:link:_net_interfaces' \
    99 		'-P[persistent flow property information]' \
   102 		'-P[persistent flow property information]' \
   100 		'-p[property to show]:property:_values -s , "property" $props' \
   103 		'-p[property to show]:property:_values -s , "property" $props' \
   101 		':flow:_flowadm_flow' \
   104 		':flow:_flowadm_flow' \
   102 	;;
   105 	;;
   103 	("show-usage")
       
   104 	_arguments -A "-*" \
       
   105 		'-a[display all historical network usage]' \
       
   106 		'-s[start time for data display (YYYY.MM.DD,hh:mm:ss)]' \
       
   107 		'-e[end time for data display (YYYY.MM.DD,hh:mm:ss)]' \
       
   108 		'-f[Read extended accounting records of network flow usage from file]:file:_files' \
       
   109 		':flow:_flowadm_flow' \
       
   110 		- set1 \
       
   111 		'-F[specifies the format of plotfile (gnuplot is only supported format)]' \
       
   112 		'-p[outputs flow usage data to a file of the format specified by the -F option]:plotfile:_files' \
       
   113 		- set2 \
       
   114 		'-d[display date in the format DD/MM/YYYY]' \
       
   115  	;;
       
   116 
   106 
   117 esac
   107 esac
   118 }
   108 }
   119 
   109 
   120 _flowadm "$@"
   110 _flowadm "$@"