All of lore.kernel.org
 help / color / mirror / Atom feed
* bash_completion errors when installed with homebrew
@ 2018-09-28 15:02 Heath Borders
  2018-10-02  9:46 ` Bernhard Ehlers
  0 siblings, 1 reply; 2+ messages in thread
From: Heath Borders @ 2018-09-28 15:02 UTC (permalink / raw)
  To: wireguard

I installed wireguard with homebrew thusly:
```
brew install wireguard-tools
```

I'm also using brew's bash completion in my `.bash_profile` and `.bashrc`:
```
if [ -f $(brew --prefix)/etc/bash_completion ]; then
  . $(brew --prefix)/etc/bash_completion
fi
```

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
```

I've traced these errors back to the following commands using `set -x`:
```
++++ complete -o nosort -F _wg_completion wg
-bash: complete: nosort: invalid option name
++++ complete -o filenames -o nosort -F _wg_quick_completion wg-quick
-bash: complete: nosort: invalid option name
```

I'm running macOS High Sierra, which runs bash version
`3.2.57(1)-release`, which doesn't support the `nosort` option. I'd
rather not upgrade my entire terminal to bash `4.4.23(1)-release` that
wireguard installs as a dependency.

I filed an issue with homebrew as well:
https://github.com/Homebrew/homebrew-core/issues/32535

Thanks!

-Heath Borders
heath.borders@gmail.com
Twitter: heathborders
http://heath-tech.blogspot.com
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bash_completion errors when installed with homebrew
  2018-09-28 15:02 bash_completion errors when installed with homebrew Heath Borders
@ 2018-10-02  9:46 ` Bernhard Ehlers
  0 siblings, 0 replies; 2+ messages in thread
From: Bernhard Ehlers @ 2018-10-02  9:46 UTC (permalink / raw)
  To: wireguard

> 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
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-02  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-28 15:02 bash_completion errors when installed with homebrew Heath Borders
2018-10-02  9:46 ` Bernhard Ehlers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.