Skip to content

Commit 93e797b

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

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

completions/brctl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# bash completion for brctl -*- shell-script -*-
22

3+
_comp_cmd_brctl__interfaces()
4+
{
5+
_comp_compgen_split -- "$(${1:-brctl} show ${2:+"$2"} 2>/dev/null | _comp_awk \
6+
'(NR == 1) { next }; (/^\t/) { print $1; next }; { print $4 }')"
7+
}
8+
39
_comp_cmd_brctl()
410
{
511
local cur prev words cword comp_args
@@ -25,9 +31,12 @@ _comp_cmd_brctl()
2531
;;
2632
3)
2733
case $command in
28-
addif | delif)
34+
addif)
2935
_comp_compgen_available_interfaces
3036
;;
37+
delif)
38+
_comp_cmd_brctl__interfaces "$1" "$prev"
39+
;;
3140
stp)
3241
_comp_compgen -- -W 'on off'
3342
;;

0 commit comments

Comments
 (0)