Merge pull request #4331 from apjanke/brew-style-complete-files

brew style zsh completion: complete files
This commit is contained in:
Mike McQuaid 2018-06-11 21:15:48 +01:00 committed by GitHub
commit 7fac0b3b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,13 @@ __brew_list_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() {
local -a formulae
formulae=($(brew search))
@ -571,8 +578,7 @@ _brew_style() {
_arguments \
'(--fix)--fix[fix style violations automatically]' \
'(--display-cop-names)--display-cop-names[include RuboCop name for each violation in output]' \
'*::formula:__brew_formulae'
# TODO add files to completion
'*::formula:__brew_formulae_or_ruby_files'
}
# brew switch name version: