From 382115bce79f59379193bcdbbeb002c8d78e46f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= Date: Wed, 11 Jan 2023 19:32:39 +0100 Subject: [PATCH] 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. --- completions/brctl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/brctl b/completions/brctl index c93716e5745..b3be4bb2596 100644 --- a/completions/brctl +++ b/completions/brctl @@ -20,11 +20,11 @@ _comp_cmd_brctl() ;; 2) case $command in - show) ;; + addbr) ;; *) _comp_compgen_split -- "$("$1" show | - _comp_awk 'NR>1 {print $1}')" + _comp_awk '(NR>1 && !/^\t/) {print $1}')" ;; esac ;;