aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMotonori Iwata2011-09-29 14:35:16 +0900
committerJack Nagel2011-10-08 20:24:59 -0500
commit58d04fe81f281f82872739b74b8e7fcb7e985351 (patch)
tree9caa065be0a9482230c65954b09777e08c786d39 /Library
parent1991f9969331b73dd55a1c3cf8901e95e0314310 (diff)
downloadhomebrew-58d04fe81f281f82872739b74b8e7fcb7e985351.tar.bz2
Make zsh completion for `upgrade` smarter
Closes #7889. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Contributions/brew_zsh_completion.zsh13
1 files changed, 10 insertions, 3 deletions
diff --git a/Library/Contributions/brew_zsh_completion.zsh b/Library/Contributions/brew_zsh_completion.zsh
index 4d7d7e43e..eb742d924 100644
--- a/Library/Contributions/brew_zsh_completion.zsh
+++ b/Library/Contributions/brew_zsh_completion.zsh
@@ -14,6 +14,10 @@ _brew_installed_formulae() {
installed_formulae=(`brew list`)
}
+_brew_outdated_formulae() {
+ outdated_formulae=(`brew outdated`)
+}
+
local -a _1st_arguments
_1st_arguments=(
'cat:display formula file for a formula'
@@ -36,12 +40,12 @@ _1st_arguments=(
'server:start a local web app that lets you browse formulae (requires Sinatra)'
'unlink:unlink a formula'
'update:freshen up links'
- 'upgrade:upgrade an installed formula'
+ 'upgrade:upgrade outdated formulae'
'uses:show formulas which depend on a formula'
)
local expl
-local -a formulae installed_formulae
+local -a formulae installed_formulae outdated_formulae
_arguments \
'(-v)-v[verbose]' \
@@ -77,7 +81,10 @@ case "$words[1]" in
install|home|homepage|log|info|abv|uses|cat|deps|edit|options)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
- remove|rm|uninstall|unlink|cleanup|link|ln|upgrade)
+ remove|rm|uninstall|unlink|cleanup|link|ln)
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
+ upgrade)
+ _brew_outdated_formulae
+ _wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
esac