sorry to bother, from the readme, this project probably is not maintaining anymore.
but i think this problem should be brought up, in case someother became the victim.
following is the cause and solution:
- the file
ag.bashcomp.sh name should be rename to ag in bash completions dir,
explantion from stackoverflow: https://unix.stackexchange.com/a/717732
Completion files in /etc/bash_completion.d are always sourced immediately by bash_completion for backwards compatibility. The completions directories, on the other hand, lazily source the scripts inside, that is, a particular completion file isn't sourced until completion is requested for that command. The file to source is determined by its name, thus it must have the same name as the command you're trying to get completions for. So, for example, tmux.completion.bash should be symlinked as completions/tmux and not completions/tmux.completion.bash.
Finally, as you're putting everything else under /usr/local, note that you can put the completion scripts there as well: /usr/local/share/bash-completion/completions.
- the bash function
_split_longopt no longer exists in bash-completion v2.16, i'm not sure in which version it was being removed though.
the simpler fix:
- _split_longopt && split=true
+ _comp__split_longopt && split=true
the slightly more complex fix (not tested):
- _split_longopt && split=true
+ # for newer version of bash completion
+ # _split_longopt is not available
+ # replaced by _comp__split_longopt
+ newfunc=$(type -t _comp__split_longopt)
+ if [ "$newfunc" = "function" ]; then
+ _comp__split_longopt && split=true
+ else
+ _split_longopt && split=true
sorry to bother, from the readme, this project probably is not maintaining anymore.
but i think this problem should be brought up, in case someother became the victim.
following is the cause and solution:
ag.bashcomp.shname should be rename toagin bashcompletionsdir,explantion from stackoverflow: https://unix.stackexchange.com/a/717732
_split_longoptno longer exists inbash-completion v2.16, i'm not sure in which version it was being removed though.the simpler fix:
the slightly more complex fix (not tested):