Installing Spring Boot CLI on Mac using homebrew does not register the command-line completion scripts

370 views Asked by At

I installed Spring Boot CLI on my Mac using Homebrew. According to the documentation:

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

So in my terminal, I expect to type spring then hit TAB to see options. I don't. How could I get the completion scripts to work/register?

1

There are 1 answers

0
Shant Dashjian On BEST ANSWER

Make Homebrew completions available in bash as described in the Homebrew documentation:

Add the following to your ~/.bash_profile (or, if it doesn’t exist, ~/.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