ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.
http://geoff.greer.fm/ag/
Apache License 2.0
26.1k stars 1.42k forks source link

Bash completion script is broken with bash-completion v2.12.0 #1537

Open jasonkarns opened 6 months ago

jasonkarns commented 6 months ago

bash-completion v2.12.0 renamed the _split_longopt function to _comp__split_longopt in https://github.com/scop/bash-completion/commit/19a3798a0bf46ad9e39a055c4113eb5e9e9cb98b. This is breaking ag's completion.

  1. with bash-completion 2.12.0 installed
  2. and silver searcher installed with completions (both the above installed via homebrew)
  3. ag SEARCHQUERY app<TAB> get:
$ ag SEARCHQUERY app-bash: _split_longopt: command not found

This is quite related to #1067 wherein it is discussed whether ag's completion script should be depending on a 3rd party completion library at all.

Regardless, the expedient fix is to replace the _split_longopt invocation with _comp__split_longopt. However, I have also opened https://github.com/scop/bash-completion/issues/1135 against bash-completion itself to resolve their opinion on if this function should be considered part of their public api. Depending on if they alias the function for a short time, or release a patch to 2.12.0, the remediation in ag's completion may change.

andrewplummer commented 5 months ago

Having the same issue.