在哪里可以找到自动完成脚本中经常使用的 _get_comp_words_by_ref 函数的文档?

Where can I find documentation for _get_comp_words_by_ref function used often in autocompletion scripts?

我正在尝试为我正在开发的工具的用户编写的 bash 完成脚本编写测试(以便我可以使它与工具本身保持同步)我想知道什么_get_comp_words_by_ref 确实如此。

样本:

local cur prev
if type _get_comp_words_by_ref &>/dev/null ; then
    _get_comp_words_by_ref cur prev
else
    cur= prev=
fi

它是 bash-completions 包的一部分,可能安装在目录 /usr/share/bash-completion 中(尽管精确路径取决于发行版)。

有一个很好的长评论in the top-level file bash-completion,其中包含许多实用函数。