Skip to content

Commit

Permalink
Add test autocompletion for zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishiking authored and jvican committed Dec 27, 2018
1 parent 4b1cf58 commit 8560829
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion etc/zsh/_bloop
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ _flags_for_cmd() {
return 0
}

_tests_or_flags() {
local prev=${words[CURRENT-1]}
local cmd=${words[1]}
if [[ $prev = '--only' || $prev = '-o' ]] && [[ $cmd = 'test' ]] then
_testsfqcn
else
_flags
fi
}

_project_or_flags() {
local project_cmd=($(bloop autocomplete --format zsh --mode project-commands))
local cmd=${words[2]}
Expand All @@ -74,6 +84,6 @@ _project_or_flags() {
_arguments \
":command:_commands" \
":project_or_flags:_project_or_flags" \
"*::flags:_flags"
"*::flags:_tests_or_flags"

return 0

0 comments on commit 8560829

Please sign in to comment.