• Re: Bug#1106336: debfoster: bash tab completion says "have: command not

    From Daniel Kahn Gillmor@21:1/5 to Marc Haber on Fri May 23 13:54:13 2025
    To: 1106336@bugs.debian.org

    Hi Marc--

    Thanks for the quick feedback here.

    On Fri 2025-05-23 07:14:10 +0200, Marc Haber wrote:
    have used to be defined for bash_completion snippets and got deprecated
    some time one year ago. Sadly without any warning or obvious informaion,
    and now it's gone.

    That seems unfortunate :(

    Does your script work again when you replace have with
    _comp_have_command?

    I'm afraid it doesn't. there is some sort of test in the final line of /usr/share/bash-completion/completions/debfoster that reads like it
    might be related to the old "have" functionality:

    ```
    test "$have" && complete -F _debfoster $default debfoster
    ```

    but i don't know the history of bash-completion well enough to know what
    this means, or whether/how to rewrite this completion script myself.

    --dkg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Daniel Kahn Gillmor@21:1/5 to Marc Haber on Mon May 26 15:44:03 2025
    To: 1106336@bugs.debian.org

    Control: tags 1106336 + patch

    Hi Marc--

    On Sat 2025-05-24 10:48:09 +0200, Marc Haber wrote:
    Try this patch:

    --- original 2025-05-24 10:45:01.169219431 +0200
    +++ /usr/share/bash-completion/completions/debfoster 2025-05-24 10:45:35.865115014 +0200
    @@ -3,7 +3,7 @@
    # Provided by Eric Hansander <ehdr@users.sourceforge.net> in
    # <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=349035>

    -have debfoster &&
    +_comp_have_command debfoster &&
    _debfoster()
    {
    local cur prev options
    @@ -38,4 +38,4 @@

    return 0
    }
    -test "$have" && complete -F _debfoster $default debfoster +_comp_have_command debfoster && complete -F _debfoster $default debfoster

    Yes, this patch looks like it works for me. thanks!

    --dkg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)