bash_completion errors when installed with homebrew

Bernhard Ehlers wg at
Tue Oct 2 11:46:38 CEST 2018

> After installing wireguard, when I open a new terminal, I see the
> following errors:
> ```
> -bash: complete: nosort: invalid option name
> -bash: complete: nosort: invalid option name
> ```

Almost all systems are using bash v4, Mac OS X is one of the few systems that
still use bash v3. Of course it’s possible to rewrite the completion scripts for v3
compatiblility, but I’m not sure if the devs are enthusiastic about that. Changes
to the completion scripts effect all systems.

In another post I suggested to change the wg-quick for OS X to support bash v3,
but that change won’t affect other systems.

My suggestion is, that the completion scripts do nothing for bash versions lower
than 4. Then this error messages won’t show up, but (of course) the completion
won’t work.

So something like this at the beginning of the completion scripts:

[[ ${BASH_VERSINFO[0]} -ge 4 ]] || return 0

More information about the WireGuard mailing list