diff options
author | Jörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org> | 2022-02-03 23:16:30 +0100 |
---|---|---|
committer | Jörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org> | 2022-02-04 17:25:08 +0100 |
commit | 5599b21c5fa6ceffa1be24b2974a4d402d06bf7a (patch) | |
tree | c60abe939c54128be6d34077d0119211bc945f01 | |
parent | c78f297cd0b63d8d9fd4efa71a992c214517f597 (diff) |
bash-completion: Use the correct index range when looking for the command word
$words[0] contains the first word on the command-line, the name of the
program: apt. Also, the last word already typed on the command-line
might be the command, don’t ignore it.
-rw-r--r-- | completions/bash/apt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/completions/bash/apt b/completions/bash/apt index 35716e7a7..94ad974b1 100644 --- a/completions/bash/apt +++ b/completions/bash/apt @@ -52,7 +52,7 @@ _apt() "policy") local command i - for (( i=0; i < ${#words[@]}-1; i++ )); do + for (( i=1; i < ${#words[@]}; i++ )); do if [[ " ${COMMANDS[*]} " == *" ${words[i]} "* ]]; then command=${words[i]} break |