Skip to content

Commit daed251

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 1cc7937 commit daed251

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
@@ -30,11 +30,11 @@ _brctl()
3030
;;
3131
2)
3232
case $command in
33-
show) ;;
33+
addbr) ;;
3434

3535
*)
3636
COMPREPLY=($(compgen -W "$("$1" show |
37-
awk 'NR>1 {print $1}')" -- "$cur"))
37+
awk '(NR>1 && !/^\t/) {print $1}')" -- "$cur"))
3838
;;
3939
esac
4040
;;

0 commit comments

Comments
 (0)