mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Bash completions: use HOMEBREW_CELLAR, if set
This commit is contained in:
parent
1cf53b4281
commit
fd5e9c8662
@ -59,7 +59,7 @@ __brew_complete_casks() {
|
|||||||
__brew_complete_installed_formulae() {
|
__brew_complete_installed_formulae() {
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
local installed_formulae
|
local installed_formulae
|
||||||
installed_formulae="$(command ls "$(brew --cellar)" 2>/dev/null)"
|
installed_formulae="$(command ls "${HOMEBREW_CELLAR:-$(brew --cellar)}" 2>/dev/null)"
|
||||||
while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${installed_formulae}" -- "${cur}")
|
while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${installed_formulae}" -- "${cur}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ __brew_complete_casks() {
|
|||||||
__brew_complete_installed_formulae() {
|
__brew_complete_installed_formulae() {
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
local installed_formulae
|
local installed_formulae
|
||||||
installed_formulae="$(command ls "$(brew --cellar)" 2>/dev/null)"
|
installed_formulae="$(command ls "${HOMEBREW_CELLAR:-$(brew --cellar)}" 2>/dev/null)"
|
||||||
while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${installed_formulae}" -- "${cur}")
|
while read -r line; do COMPREPLY+=("${line}"); done < <(compgen -W "${installed_formulae}" -- "${cur}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user