Skip to content

Commit abce117

Browse files
committed
feat(brctl): for delif commnd offer only bridged interfaces
When completing a delif command offer only interfaces that are part of the selected bridge.
1 parent b5a7cd8 commit abce117

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

completions/brctl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# bash completion for brctl -*- shell-script -*-
2+
_comp_xfunc_brctl_interfaces()
3+
{
4+
_comp_compgen_split -- "$(${1:-brctl} show ${2:+"$2"} 2>/dev/null | _comp_awk \
5+
'(NR == 1) { next }; (/^\t/) { print $1; next }; { print $4 }')"
6+
}
27

38
_comp_cmd_brctl()
49
{
@@ -25,9 +30,12 @@ _comp_cmd_brctl()
2530
;;
2631
3)
2732
case $command in
28-
addif | delif)
33+
addif)
2934
_comp_compgen_available_interfaces
3035
;;
36+
delif)
37+
_comp_xfunc_brctl_interfaces "$1" "$prev"
38+
;;
3139
stp)
3240
_comp_compgen -- -W 'on off'
3341
;;

0 commit comments

Comments
 (0)