summaryrefslogtreecommitdiff
path: root/completions/iperf
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2019-08-07 09:17:13 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2019-08-07 09:17:13 -0300
commit5732da2af736c40cf693354485446ab4867ecb4d (patch)
tree76d76cdfa16ca62d20fb109da13895ec64fff110 /completions/iperf
parent9cd22d1df8f0f5b554858471c86faa9f37b8fed4 (diff)
downloadbash-completion-5732da2af736c40cf693354485446ab4867ecb4d.tar.gz
New upstream version 2.9upstream/2.9
Diffstat (limited to 'completions/iperf')
-rw-r--r--completions/iperf46
1 files changed, 26 insertions, 20 deletions
diff --git a/completions/iperf b/completions/iperf
index 712ab946..43f9bcaf 100644
--- a/completions/iperf
+++ b/completions/iperf
@@ -3,37 +3,43 @@
_iperf()
{
local cur prev words cword split
- _init_completion -s || return
+ _init_completion -s -n : || return
case $prev in
- -h|--help|-v|--version|-i|--interval|-l|--len|-p|--port|-w|--window|\
- -M|--mss|-b|--bandwidth|-n|--num|-t|--time|-L|--listenport|-P|\
- --parallel|-T|--ttl|-Z|--linux-congestion)
+ --help|--version|--interval|--len|--port|--window|--mss|--bandwidth|\
+ --num|--time|--listenport|--parallel|--ttl|--linux-congestion|--omit|\
+ --congestion|--bytes|--blockcount|--cport|--set-mss|--flowlabel|\
+ --title|--tos|--affinity|-!(-*)[hvilpwMbntLPTZCkOSA])
return
;;
- -f|--format)
- COMPREPLY=( $( compgen -W 'k m K M' -- "$cur" ) )
+ --format|-!(-*)f)
+ COMPREPLY=( $(compgen -W 'k m g K M G' -- "$cur") )
return
;;
- -o|--output|-F|--fileinput)
+ --output|--fileinput|-!(-*)[oF])
_filedir
return
;;
- -B|--bind)
+ --bind|-!(-*)B)
_available_interfaces -a
- _ip_addresses
+ _ip_addresses -a
+ __ltrim_colon_completions "$cur"
return
;;
- -c|--client)
+ --client|-!(-*)c)
_known_hosts_real -- "$cur"
return
;;
- -x|--reportexclude)
- COMPREPLY=( $( compgen -W 'C D M S V' -- "$cur" ) )
+ --reportexclude|-!(-*)x)
+ COMPREPLY=( $(compgen -W 'C D M S V' -- "$cur") )
return
;;
- -y|--reportstyle)
- COMPREPLY=( $( compgen -W 'C' -- "$cur" ) )
+ --reportstyle|-!(-*)y)
+ COMPREPLY=( $(compgen -W 'C' -- "$cur") )
+ return
+ ;;
+ --logfile)
+ _filedir log
return
;;
esac
@@ -42,22 +48,22 @@ _iperf()
# Filter mode specific options
local i filter=cat
- for i in ${words[@]}; do
+ for i in "${words[@]}"; do
case $i in
-s|--server)
- filter='command sed -e /^Client.specific/,/^$/d'
+ filter='command sed -e /^Client.specific/,/^\(Server.specific.*\)\?$/d'
;;
-c|--client)
- filter='command sed -e /^Server.specific/,/^$/d'
+ filter='command sed -e /^Server.specific/,/^\(Client.specific.*\)\?$/d'
;;
esac
done
[[ $filter != cat ]] && filter+=' -e /--client/d -e /--server/d'
- COMPREPLY=( $( compgen -W \
- '$( "$1" --help 2>&1 | $filter | _parse_help - )' -- "$cur" ) )
+ COMPREPLY=( $(compgen -W \
+ '$("$1" --help 2>&1 | $filter | _parse_help -)' -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
-complete -F _iperf iperf
+complete -F _iperf iperf iperf3
# ex: filetype=sh