From c00fc9152cd2e60f875ece211bc61355a7f0d719 Mon Sep 17 00:00:00 2001 From: Jörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org> Date: Thu, 20 Jan 2022 23:52:13 +0000 Subject: bash-completion: Don’t misidentify short options as commands to `apt` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the comparison would match `-s` with `edit-sources`, `-d` with `build-dep` etc. and the real commands would not get suggested after some of the short options. --- completions/bash/apt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/bash/apt b/completions/bash/apt index 7cf54df1f..a0da8f6f7 100644 --- a/completions/bash/apt +++ b/completions/bash/apt @@ -53,7 +53,7 @@ _apt() local command i for (( i=0; i < ${#words[@]}-1; i++ )); do - if [[ ${COMMANDS[@]} =~ ${words[i]} ]]; then + if [[ " ${COMMANDS[*]} " == *" ${words[i]} "* ]]; then command=${words[i]} break fi -- cgit v1.2.3-70-g09d2