Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

speedup bash completion loading suggestion in docs #6105

Merged
merged 1 commit into from May 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/Shell-Completion.md
Expand Up @@ -11,14 +11,15 @@ You must configure your shell to enable the completion support. This is because
To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell startup. Add the following to your `~/.bash_profile` file:

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