使用自制软件在Mac上安装Spring Boot CLI不会注册命令行完成脚本



我使用Homebrew在Mac上安装了Spring Boot CLI。根据文件:

If you install the Spring Boot CLI by using Homebrew or MacPorts, the command-line completion scripts are automatically registered with your shell.

因此,在我的终端中,我希望键入spring,然后点击TAB查看选项。我没有。我如何才能让完成脚本工作/注册?

如Homebrew文档中所述,在bash中提供Homebrew完成:

将以下内容添加到您的~/.bash_profile(如果不存在,则添加到~/.profile(:

if type brew &>/dev/null; then
HOMEBREW_PREFIX="$(brew --prefix)"
if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
else
for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"*; do
[[ -r "$COMPLETION" ]] && source "$COMPLETION"
done
fi
fi