Skip to content

Commit ca5ea03

Browse files
committed
feat(ip): Complete link types for address show
1 parent 8e60245 commit ca5ea03

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

completions/ip

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,13 @@ _comp_cmd_ip()
177177
_comp_compgen_available_interfaces
178178
_comp_compgen -a -- -W 'dev scope to label dynamic
179179
permanent tentative deprecated dadfailed temporary
180-
primary secondary up'
180+
primary secondary up type'
181181
elif [[ $prev == dev ]]; then
182182
_comp_compgen_available_interfaces
183183
elif [[ $prev == scope ]]; then
184184
_comp_cmd_ip__iproute2_etc rt_scopes
185+
elif [[ $prev == type ]]; then
186+
_comp_cmd_ip__link_types "$1"
185187
fi
186188
;;
187189
*)

test/t/test_ip.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ def test_monitor(self, completion):
2727
def test_netconf(self, completion):
2828
assert "show" in completion
2929

30+
@pytest.mark.complete(
31+
"ip addr show type ",
32+
require_cmd=True,
33+
skipif="ip link help 2>/dev/null; (( $? != 255 ))",
34+
)
35+
def test_addr_type(self, completion):
36+
assert "bridge" in completion
37+
3038
@pytest.mark.complete("ip -", require_cmd=True)
3139
def test_options(self, completion):
3240
assert "-family" in completion

0 commit comments

Comments
 (0)