diff options
| author | Ches Martin | 2014-05-25 23:05:00 +0700 |
|---|---|---|
| committer | Adam Vandenberg | 2014-05-25 09:48:29 -0700 |
| commit | 95dfda6ca816a62b47e1d9ed9c3a41e622d921f9 (patch) | |
| tree | 732a62f3fb87a7e2c67f9e612e22ffeabe40baf1 /Library | |
| parent | 8a08d101147a8ff3a60bf6b5e6ee24f0f84c7de6 (diff) | |
| download | brew-95dfda6ca816a62b47e1d9ed9c3a41e622d921f9.tar.bz2 | |
bash completion for `brew list --multiple`
As per 9ab605c7f1883 removal of `brew dirty`. `--multiple` *implies*
`--versions`, thus IMO it shouldn't be necessary to also explicitly
include the `--versions` option, but that's a separate matter. For now
this offers the small added convenience of:
$ brew list --m<TAB><TAB>
to quickly expand the `brew dirty` equivalent.
Closes Homebrew/homebrew#29571.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/brew_bash_completion.sh | 19 |
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 () |
