zsh-completion: add tap-(un)pin

Closes Homebrew/homebrew#43146.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-08-21 12:39:50 +08:00
parent 329358c33c
commit 1da2855c0b

View File

@ -23,6 +23,10 @@ _brew_official_taps() {
official_taps=(`brew tap --list-official`)
}
_brew_pinned_taps() {
pinned_taps=(`brew tap --list-pinned`)
}
_brew_outdated_formulae() {
outdated_formulae=(`brew outdated`)
}
@ -59,6 +63,8 @@ _1st_arguments=(
'switch:switch between different versions of a formula'
'tap:tap a new formula repository from GitHub, or list existing taps'
'tap-info:information about a tap'
'tap-pin:pin a tap'
'tap-unpin:unpin a tap'
'test-bot:test a formula and build a bottle'
'uninstall:uninstall a formula'
'unlink:unlink a formula'
@ -110,12 +116,15 @@ case "$words[1]" in
_arguments \
'(--macports)--macports[search the macports repository]' \
'(--fink)--fink[search the fink repository]' ;;
untap|tap-info)
untap|tap-info|tap-pin)
_brew_installed_taps
_wanted installed_taps expl 'installed taps' compadd -a installed_taps ;;
tap)
_brew_official_taps
_wanted official_taps expl 'official taps' compadd -a official_taps ;;
tap-unpin)
_brew_pinned_taps
_wanted pinned_taps expl 'pinned taps' compadd -a pinned_taps ;;
upgrade)
_brew_outdated_formulae
_wanted outdated_formulae expl 'outdated formulae' compadd -a outdated_formulae ;;