summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org>2022-01-20 23:52:13 +0000
committerJörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org>2022-02-01 14:35:36 +0100
commitc00fc9152cd2e60f875ece211bc61355a7f0d719 (patch)
tree66ea3af080d8d7c8af266e840bcd7b2c87aa41e9
parenta25a4d3372ca621c4a98e369578e2769029e17be (diff)
bash-completion: Don’t misidentify short options as commands to `apt`
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.
-rw-r--r--completions/bash/apt2
1 files changed, 1 insertions, 1 deletions
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