Merge pull request #3679 from alyssais/zsh_cask_completion

Don't auto-tap caskroom/cask in ZSH completion
This commit is contained in:
Alyssa Ross 2018-01-13 13:53:43 +00:00 committed by GitHub
commit 9a82eb6212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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