diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-17 14:57:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-17 14:57:17 +0000 |
commit | 8c80e4dce14eed4e3c06b16fc307c6c7d20b9af8 (patch) | |
tree | 4477eaed15415ddadc3e88205234659628759415 /completions/ip | |
parent | Releasing progress-linux version 1:2.13.0-1~progress7.99u1. (diff) | |
download | bash-completion-8c80e4dce14eed4e3c06b16fc307c6c7d20b9af8.tar.xz bash-completion-8c80e4dce14eed4e3c06b16fc307c6c7d20b9af8.zip |
Merging upstream version 1:2.14.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/ip')
-rw-r--r-- | completions/ip | 105 |
1 files changed, 86 insertions, 19 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? : ;; *) |