From b5ae4eb3a7ae08ff2ae0f4178926d4049e3cc19c 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 00ce145fadf..148e1178c08 100644 --- a/completions/brctl +++ b/completions/brctl @@ -21,11 +21,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 ;;