Skip to content

Commit 8e60245

Browse files
yedayakakinomyoga
andcommitted
feat(ip): Create function to get link types
Create _comp_cmd_ip__link_types function that gets all the link types supported by the ip command Co-Authored-By: Koichi Murase <myoga.murase@gmail.com>
1 parent fdd8048 commit 8e60245

File tree

1 file changed

+13
-0
lines changed
  • completions

1 file changed

+13
-0
lines changed

completions/ip

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ _comp_cmd_ip__netns()
1515
)"
1616
}
1717

18+
_comp_cmd_ip__link_types()
19+
{
20+
_comp_compgen_split -- "$(
21+
{
22+
${1-ip} -c=never link help || ${1-ip} link help
23+
} 2>&1 | command sed -e \
24+
'/TYPE := /,/}/!d' -e \
25+
's/.*{//' -e \
26+
's/}.*//' -e \
27+
's/|/ /g'
28+
)"
29+
}
30+
1831
_comp_cmd_ip()
1932
{
2033
local cur prev words cword comp_args

0 commit comments

Comments
 (0)