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>
This commit is contained in:
parent
8a08d10114
commit
95dfda6ca8
@ -282,25 +282,38 @@ _brew_linkapps ()
|
|||||||
|
|
||||||
_brew_list ()
|
_brew_list ()
|
||||||
{
|
{
|
||||||
|
local allopts="--unbrewed --verbose --pinned --versions --multiple"
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--*)
|
--*)
|
||||||
# options to brew-list are mutually exclusive
|
# most options to brew-list are mutually exclusive
|
||||||
if __brewcomp_words_include "--unbrewed"; then
|
if __brewcomp_words_include "--unbrewed"; then
|
||||||
return
|
return
|
||||||
elif __brewcomp_words_include "--verbose"; then
|
elif __brewcomp_words_include "--verbose"; then
|
||||||
return
|
return
|
||||||
elif __brewcomp_words_include "--pinned"; then
|
elif __brewcomp_words_include "--pinned"; then
|
||||||
return
|
return
|
||||||
|
# --multiple only applies with --versions
|
||||||
|
elif __brewcomp_words_include "--multiple"; then
|
||||||
|
__brewcomp "--versions"
|
||||||
|
return
|
||||||
elif __brewcomp_words_include "--versions"; then
|
elif __brewcomp_words_include "--versions"; then
|
||||||
|
__brewcomp "--multiple"
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
__brewcomp "--unbrewed --verbose --pinned --versions"
|
__brewcomp "$allopts"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
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 ()
|
_brew_log ()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user