Improve homebrew tab completion

This commit is contained in:
Michael Thorpe 2013-07-16 10:56:01 +01:00
commit fad9fb5ff1

View file

@ -11,6 +11,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'
@ -75,6 +79,9 @@ case "$words[1]" in
install|home|homepage|log|info|abv|uses|cat|deps|edit|options|versions)
_brew_all_formulae
_wanted formulae expl 'all formulae' compadd -a formulae ;;
upgrade)
_brew_outdated_formulae
_wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;
remove|rm|uninstall|unlink|cleanup|link|ln)
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;