Skip to content

Commit b5ae4eb

Browse files
committed
fix(brctl): switch handling of show and addbr
The show subcommand accepts a bridge name as a paramenter so let's offer completion. On the other hand addbr creates new interface and requires a name that doesn't exist yet. Longer awk condition prevents offering interfaces that are parts of bridges. They are all displayed in the last column but with all other columns being blang on the second and following lines of each bridge the last column is also the first.
1 parent 93e797b commit b5ae4eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

completions/brctl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ _comp_cmd_brctl()
2121
;;
2222
2)
2323
case $command in
24-
show) ;;
24+
addbr) ;;
2525

2626
*)
2727
_comp_compgen_split -- "$("$1" show |
28-
_comp_awk 'NR>1 {print $1}')"
28+
_comp_awk '(NR>1 && !/^\t/) {print $1}')"
2929
;;
3030
esac
3131
;;

0 commit comments

Comments
 (0)