Closed pjcdawkins closed 9 years ago
Hmm, this is another thing where I'm not sure if it belongs in this module or in user code.. I've seen that error come up when bash-completion is missing / not loaded. Have you seen it in any other cases? Looking at the bash-completion repo, those two functions appeared in version 1.2 (mid 2010) so they're relatively recent; older versions would also see those errors.
Code wise, I think this is a little bit clearer:
if [ "$(type -t _get_comp_words_by_ref)" == "function" ]; then
...
fi;
Personally I can deal with this in my own code. I haven't found a clean way to check for the installed version of bash-completion itself. That type
command doesn't work on my Mac by the way.
I'm not sure if this is the right approach, but this is to avoid these kinds of errors on (weird) Bash shells when bash-completion is not installed.