Don't auto-tap caskroom/cask in ZSH completion

The Bash completion just uses the directory tree rather than invoking
`brew cask`, so doesn't exhibit the same behaviour.
This commit is contained in:
Alyssa Ross 2018-01-13 11:03:34 +00:00
parent 651988bf55
commit 2694fbd6a0
No known key found for this signature in database
GPG Key ID: 6CF064D149E3ABDB

View File

@ -12,17 +12,21 @@
zstyle -T ':completion:*:*:*:brew-cask:*' tag-order && \
zstyle ':completion:*:*:*:brew-cask:*' tag-order 'commands'
__brew_cask() {
[ -d "$(brew --repo caskroom/cask)" ] && brew cask $@
}
__brew_all_casks() {
local -a list
local expl
list=( $(brew cask search) )
list=( $(__brew_cask search) )
_wanted list expl 'all casks' compadd -a list
}
__brew_installed_casks() {
local -a list
local expl
list=( $(brew cask list|sed 's/(!)//') )
list=( $(__brew_cask list|sed 's/(!)//') )
_wanted list expl 'installed casks' compadd -a list
}