diff options
Diffstat (limited to '')
-rw-r--r-- | completions/ip | 105 | ||||
-rw-r--r-- | completions/iperf | 10 |
2 files changed, 93 insertions, 22 deletions
diff --git a/completions/ip b/completions/ip index 09bec5b..3b495b6 100644 --- a/completions/ip +++ b/completions/ip @@ -121,6 +121,13 @@ _comp_cmd_ip() add) # TODO ;; + afstats) + if [[ $prev == dev ]]; then + _comp_compgen_available_interfaces + else + _comp_compgen -- -W 'dev' + fi + ;; delete) if [[ $prev == type ]]; then _comp_cmd_ip__link_types "$1" @@ -129,7 +136,7 @@ _comp_cmd_ip() _comp_compgen -a -- -W 'type' fi ;; - set) + set | change) if ((cword - subcword == 1)); then _comp_compgen_available_interfaces else @@ -173,7 +180,7 @@ _comp_cmd_ip() ;; *) ((cword == subcword)) && - _comp_compgen -- -W 'help add delete set show property' + _comp_compgen -- -W 'help add change delete set show property afstats' ;; esac ;; @@ -181,13 +188,24 @@ _comp_cmd_ip() a | addr | address) case $subcmd in add | change | replace) - if [[ $prev == dev ]]; then - _comp_compgen_available_interfaces - elif [[ $prev == scope ]]; then - _comp_cmd_ip__iproute2_etc rt_scopes - else - : # TODO - fi + case $prev in + dev | label) + _comp_compgen_available_interfaces + ;; + scope) + _comp_cmd_ip__iproute2_etc rt_scopes + ;; + broadcast | anycast | peer | metric) + : + ;; + valid_lft | preferred_lft) + _comp_compgen -- -W 'forever' + ;; + *) + _comp_compgen -- -W 'anycast autojoin broadcast dev home label scope nodad metric mngtmpaddr + noprefixroute valid_lft peer preferred_lft' + ;; + esac ;; del) if [[ $prev == dev ]]; then @@ -241,15 +259,45 @@ _comp_cmd_ip() r | route) case $subcmd in - list | flush) - if [[ $prev == proto ]]; then - _comp_cmd_ip__iproute2_etc rt_protos - else - : # TODO - fi + list | flush | save) + case "$prev" in + proto) + _comp_cmd_ip__iproute2_etc rt_protos + ;; + table) + _comp_compgen -- -W 'local main default all' + ;; + scope) + _comp_cmd_ip__iproute2_etc rt_scopes + ;; + root | match | exact | vrf) + : # TODO: Can we complete vrf? + ;; + type) + _comp_compgen -- -W 'unicast local broadcast multicast throw unreachable prohibit blackhole nat' + ;; + *) + _comp_compgen -- -W 'root match exact table vrf proto type scope' + ;; + esac ;; get) - # TODO + case $prev in + as | dport | from | sport | ipproto | vrf | to | tos | mark) + : # TODO: Can we complete ipproto, tos, or vrf? + ;; + uid) + _comp_compgen_uids + ;; + oif | iif | dev) + _comp_compgen_available_interfaces -a + ;; + *) + # TODO: 'iif' only works if also 'from' is specified + _comp_compgen -- -W 'as connected dport from fibmatch + iif ipproto mark notify oif sport to tos uid vrf' + ;; + esac ;; a | add | d | del | change | append | r | replace) if [[ $prev == via ]]; then @@ -276,7 +324,7 @@ _comp_cmd_ip() *) ((cword == subcword)) && _comp_compgen -- -W 'help list flush get add del change - append replace' + append replace save showdump' ;; esac ;; @@ -357,7 +405,26 @@ _comp_cmd_ip() n | neigh | neighbor | neighbour) case $subcmd in add | del | change | replace) - # TODO + case $prev in + lladdr) + _comp_compgen_mac_addresses + ;; + nud) + _comp_cmd_ip__neigh_states "$1" + ;; + dev) + _comp_compgen_available_interfaces + ;; + protocol) + _comp_cmd_ip__iproute2_etc rt_protos + ;; + proxy) + : + ;; + *) + _comp_compgen -- -W 'lladdr nud proxy dev router use managed extern_learn protocol' + ;; + esac ;; show | flush) case "$prev" in @@ -367,7 +434,7 @@ _comp_cmd_ip() dev) _comp_compgen_available_interfaces ;; - nomaster | proxy | to | vrf) # TODO - Maybe we can complete vrf here? + to | vrf) # TODO - Maybe we can complete vrf here? : ;; *) diff --git a/completions/iperf b/completions/iperf index 0168814..ef2860a 100644 --- a/completions/iperf +++ b/completions/iperf @@ -5,16 +5,16 @@ _comp_cmd_iperf() local cur prev words cword was_split comp_args _comp_initialize -s -n : -- "$@" || return - local noargopts='!(-*|*[ilpwMXbntLPTZCkOSAfIoFBcxy]*)' + local noargopts='!(-*|*[ilpwMXbntLPTZCkOAfIoFBcxy]*)' # shellcheck disable=SC2254 case $prev in --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 | --rcv-timeout | --server-bitrate-limit | \ + --title | --affinity | --rcv-timeout | --server-bitrate-limit | \ --idle-timeout | --time-skew-threshold | --xbind | --nstreams | --connect-timeout | \ --bitrate | --pacing-timer | --fq-rate | --length | --dscp | --extra-data | \ - --username | -${noargopts}[hvilpwMXbntLPTZCkOSA]) + --username | -${noargopts}[hvilpwMXbntLPTZCkOA]) return ;; --format | -${noargopts}f) @@ -59,6 +59,10 @@ _comp_cmd_iperf() _comp_compgen_filedir log return ;; + --tos | -${noargopts}S) + _comp_compgen -- -W '{0..255}' + return + ;; --rsa-private-key-path | --rsa-public-key-path) _comp_compgen_filedir pem return |