aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Contributions
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Contributions')
-rw-r--r--Library/Contributions/brew_bash_completion.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh
index 6f97935f0..9aa58fed1 100644
--- a/Library/Contributions/brew_bash_completion.sh
+++ b/Library/Contributions/brew_bash_completion.sh
@@ -282,25 +282,38 @@ _brew_linkapps ()
_brew_list ()
{
+ local allopts="--unbrewed --verbose --pinned --versions --multiple"
local cur="${COMP_WORDS[COMP_CWORD]}"
+
case "$cur" in
--*)
- # options to brew-list are mutually exclusive
+ # most options to brew-list are mutually exclusive
if __brewcomp_words_include "--unbrewed"; then
return
elif __brewcomp_words_include "--verbose"; then
return
elif __brewcomp_words_include "--pinned"; then
return
+ # --multiple only applies with --versions
+ elif __brewcomp_words_include "--multiple"; then
+ __brewcomp "--versions"
+ return
elif __brewcomp_words_include "--versions"; then
+ __brewcomp "--multiple"
return
else
- __brewcomp "--unbrewed --verbose --pinned --versions"
+ __brewcomp "$allopts"
return
fi
;;
esac
- __brew_complete_installed
+
+ # --multiple excludes formulae and *implies* --versions...
+ if __brewcomp_words_include "--multiple"; then
+ __brewcomp "--versions"
+ else
+ __brew_complete_installed
+ fi
}
_brew_log ()