From 76eea74581d4f404e817f686ea86236c8c75a9fc Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 12 Aug 2023 06:12:20 +0900 Subject: [PATCH] fix(_comp_count_args): ignore empty $3 --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 91450688726..a0f65954b1f 100644 --- a/bash_completion +++ b/bash_completion @@ -2193,7 +2193,7 @@ _comp_count_args() ret=1 for ((i = 1; i < cword; i++)); do # shellcheck disable=SC2053 - if [[ (${words[i]} != -?* || ${words[i]} == ${3-}) && + if [[ (${words[i]} != -?* || ${3-} && ${words[i]} == ${3-}) && ${words[i - 1]} != ${2-} ]]; then ((ret++)) elif [[ ${words[i]} == -- ]]; then