Subject: [bug#63860] [PATCH v2] Add Bash completion file.

From: Oleg Pykhalov <[email-masked]>
Date: Sat, 03 Jun 2023 22:28:23 +0300

Liliana Marie Prikler <[email-masked]> writes:

[…]

>> +{
>> +    local command="${COMP_WORDS[1]}"
>> +    case "$command" in
>> +        discover)
>> +            complitions="guix-daemon"
>> +            mapfile -t COMPREPLY < <(compgen -W "$complitions" --
>> "${COMP_WORDS[$COMP_CWORD]}")
>> +            ;;
> Is there a reason to call the variable "complitions" rather than
> "completions"

No reason, it's a typo probably from autocompletion of my editor. :-)

> or using an immediate value?

Do you mean to use the following?
--8<---------------cut here---------------start------------->8---
    case "$command" in
        discover)
            mapfile -t COMPREPLY < <(compgen -W guix-daemon -- "${COMP_WORDS[$COMP_CWORD]}")
            ;;
    ...
--8<---------------cut here---------------end--------------->8---

yes, this will work.

No strong opinion on that, both ways would work for me.

Regards,
Oleg.