diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2012-06-21 08:50:14 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2012-06-21 08:50:14 +0000 |
commit | 71052cb69c455f8182e8f85ba8d4ea4be7e5caf0 (patch) | |
tree | 3cc9aa0959c21dfd32344e068dea009ec9f0af08 /Completion/Solaris/Command/_flowadm | |
parent | cbb8a3c762ba6034e5ae0c35e6d04c2de130f933 (diff) | |
download | zsh-71052cb69c455f8182e8f85ba8d4ea4be7e5caf0.tar.gz zsh-71052cb69c455f8182e8f85ba8d4ea4be7e5caf0.tar.xz zsh-71052cb69c455f8182e8f85ba8d4ea4be7e5caf0.zip |
Danek (plus .distfiles): 30520: updated Solaris 11 copmletion
Diffstat (limited to 'Completion/Solaris/Command/_flowadm')
-rw-r--r-- | Completion/Solaris/Command/_flowadm | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/Completion/Solaris/Command/_flowadm b/Completion/Solaris/Command/_flowadm new file mode 100644 index 000000000..2a18ecc8d --- /dev/null +++ b/Completion/Solaris/Command/_flowadm @@ -0,0 +1,110 @@ +#compdef flowadm +# Synced with the Nevada build 171 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) +} + +subcmds=( + "show-flow" + "add-flow" + "remove-flow" + "set-flowprop" + "reset-flowprop" + "show-flowprop" +) + +tr=( + "tcp" + "udp" + "sctp" + "icmp" + "icmpv6" +) + +props=( + "maxbw" +) + +if [[ $service == "flowadm" ]]; then + _arguments -C -A "-*" \ + '*::command:->subcmd' && return 0 + + if (( CURRENT == 1 )); then + _wanted commands expl "flowadm subcommand" compadd -a subcmds + return + fi + service="$words[1]" + curcontext="${curcontext%:*}=$service:" +fi +case $service in + + ("show-flow") + _arguments -A "-*" \ + '-o[specify field to display]:field:(flow link ipaddr proto port dsfield)' \ + '-p[parsable output]' \ + '-P[persistent flow property information]' \ + - set1 \ + '-l[display information for link]:link or flow:_net_interfaces' \ + - set2 \ + ':flow:_flowadm_flow' \ + ;; + + ("add-flow") + _arguments -A "-*" \ + '-t[temporary changes - do not persist across reboots]' \ + '-R[alternate root dir]:alternate root:_files' \ + '-l[specify link to which flow will be added]:link:_net_interfaces' \ + '-a[specify attribute]:attribute:(local_ip= remote_ip= transport=$tr local_port= dsfield=)' \ + '-p[set property value]:property:(maxbw=)' \ + ;; + + ("remove-flow") + _arguments -A "-*" \ + '-t[temporary changes - do not persist across reboots]' \ + '-R[alternate root dir]:alternate root:_files' \ + - set1 \ + '-l[specify link from which flow will be deleted]:link:_net_interfaces' \ + - set2 \ + ':flow:_flowadm_flow' \ + ;; + + ("set-flowprop") + _arguments -A "-*" \ + '-t[temporary changes - do not persist across reboots]' \ + '-R[alternate root dir]:alternate root:_files' \ + '-p[set property value]:property:(maxbw=)' \ + ':flow:_flowadm_flow' \ + ;; + + ("reset-flowprop") + _arguments -A "-*" \ + '-t[temporary changes - do not persist across reboots]' \ + '-R[alternate root dir]:alternate root:_files' \ + '-p[set property value]:property:(maxbw=)' \ + ':flow:_flowadm_flow' \ + ;; + + ("show-flowprop") + _arguments -A "-*" \ + '-c[parsable output (requires -o)]' \ + '-l[specify link whose properties will be shown]:link:_net_interfaces' \ + '-P[persistent flow property information]' \ + '-p[property to show]:property:_values -s , "property" $props' \ + ':flow:_flowadm_flow' \ + ;; + +esac +} + +_flowadm "$@" |