diff --git a/completions/ip b/completions/ip index 260d4a63543..2babfd6ba8f 100644 --- a/completions/ip +++ b/completions/ip @@ -177,11 +177,13 @@ _comp_cmd_ip() _comp_compgen_available_interfaces _comp_compgen -a -- -W 'dev scope to label dynamic permanent tentative deprecated dadfailed temporary - primary secondary up' + primary secondary up type' elif [[ $prev == dev ]]; then _comp_compgen_available_interfaces elif [[ $prev == scope ]]; then _comp_cmd_ip__iproute2_etc rt_scopes + elif [[ $prev == type ]]; then + _comp_cmd_ip__link_types "$1" fi ;; *) diff --git a/test/t/test_ip.py b/test/t/test_ip.py index 6c949c4b14d..5136c665675 100644 --- a/test/t/test_ip.py +++ b/test/t/test_ip.py @@ -27,6 +27,14 @@ def test_monitor(self, completion): def test_netconf(self, completion): assert "show" in completion + @pytest.mark.complete( + "ip addr show type ", + require_cmd=True, + skipif="ip link help 2>/dev/null; (( $? != 255 ))", + ) + def test_addr_type(self, completion): + assert "bridge" in completion + @pytest.mark.complete("ip -", require_cmd=True) def test_options(self, completion): assert "-family" in completion