brew style zsh completion: complete files

This commit is contained in:
Andrew Janke 2018-06-11 15:35:55 -04:00
parent 22e9fd7729
commit 65304ec3f2

View File

@ -32,6 +32,13 @@ __brew_list_aliases() {
echo "${aliases}" echo "${aliases}"
} }
__brew_formulae_or_ruby_files() {
local -a formulae
formulae=($(brew search))
_alternative 'formulae::__brew_formulae' \
'files:files:{_files -g *.rb}'
}
__brew_formulae() { __brew_formulae() {
local -a formulae local -a formulae
formulae=($(brew search)) formulae=($(brew search))
@ -571,8 +578,7 @@ _brew_style() {
_arguments \ _arguments \
'(--fix)--fix[fix style violations automatically]' \ '(--fix)--fix[fix style violations automatically]' \
'(--display-cop-names)--display-cop-names[include RuboCop name for each violation in output]' \ '(--display-cop-names)--display-cop-names[include RuboCop name for each violation in output]' \
'*::formula:__brew_formulae' '*::formula:__brew_formulae_or_ruby_files'
# TODO add files to completion
} }
# brew switch name version: # brew switch name version: