Recommend commenting out the formula Caveats code

This commit is contained in:
Ishan Goel 2020-07-16 18:03:51 +04:00 committed by GitHub
parent 9ae1c1aafa
commit 7115427e78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,14 @@ fi
```
Should you later install the `bash-completion@2` formula, this will automatically use its initialization script to read the completions files.
When installed, the `bash-completion@2` formula also runs `${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh` and all files in the `bash_completion.d` directory (If the Caveats section is followed after installation, of course). Therefore, it is recommended to comment out the block of code given above after installing `bash-completion@2` because it becomes redundant.
When installed, the `bash-completion@2` formula also runs `${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh` and all files in the `bash_completion.d` directory. This is done by adding a line to your `.bash_profile` -
```
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
```
which is mentioned in the Caveats section upon the installation of `bash-completion@2`
As both Homebrew's completion code given above and the Caveats line do the same thing, it is recommended to either not add the Caveats line or to comment the line out because Homebrew's completion code works even without installing the `bash-completion@2` formula.
## Configuring Completions in `zsh`