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 committed Dec 5, 2018
1 parent 3cf0744 commit 01e8aa5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion etc/zsh/_bloop
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ _flags_for_cmd() {
return 0
}

_tests_or_flags() {
local cmd=${words[2]}
if [[ $words[CURRENT-1] = '--only' && $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 +83,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 01e8aa5

Please sign in to comment.