From 62a49acda34d491626e4ab79db1df786eb9c44bf Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 25 Mar 2024 20:55:24 +0100 Subject: [PATCH] completions/iwctl: fix spurious error on "iwctl device foo" --- share/completions/iwctl.fish | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/completions/iwctl.fish b/share/completions/iwctl.fish index 52e277a32..d1ee6788e 100644 --- a/share/completions/iwctl.fish +++ b/share/completions/iwctl.fish @@ -26,12 +26,11 @@ function __iwctl_filter -w iwctl end printf "\n" end - else + else if set -q column_widths[1] # only take lines starting with ` `, i.e., no `No devices ...` # then take the first column as substring string match " *" $results[5..] | string sub -s (math $leading_ws + 1) -l $column_widths[1] | string trim -r end - # string match -rg " .{$(math $header_spaces[1] - 2)}(.{$(math $first_column_label + $header_spaces[2])})" $results[5..] | string trim end function __iwctl_match_subcoms