Answers:
最简单的方法是bash-completion
从自制程序安装并按照提供的说明进行操作。
输出示例:
==> Downloading https://homebrew.bintray.com/bottles/bash-completion-1.3.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring bash-completion-1.3.mavericks.bottle.tar.gz
==> Caveats
Add the following lines to your ~/.bash_profile:
if [ -f "$(brew --prefix)/etc/bash_completion" ]; then
source "$(brew --prefix)/etc/bash_completion"
fi
The Homebrew bash completion script has been installed to:
/usr/local/etc/bash_completion.d
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/bash-completion/1.3: 188 files, 1.1M
完成后,您可以在下创建自己的脚本/usr/local/etc/bash_completion.d/
。