Skip to content

Commit 382115b

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 abce117 commit 382115b

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
@@ -20,11 +20,11 @@ _comp_cmd_brctl()
2020
;;
2121
2)
2222
case $command in
23-
show) ;;
23+
addbr) ;;
2424

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

0 commit comments

Comments
 (0)