From 01e8aa50e4e7771d9d0ef4601ee4f6eaec7e6c53 Mon Sep 17 00:00:00 2001 From: tanishiking Date: Wed, 5 Dec 2018 03:01:05 +0900 Subject: [PATCH] Add test autocompletion for zsh https://github.com/scalacenter/bloop/issues/426 --- etc/zsh/_bloop | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/etc/zsh/_bloop b/etc/zsh/_bloop index bbad483c29..2617873568 100644 --- a/etc/zsh/_bloop +++ b/etc/zsh/_bloop @@ -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]} @@ -74,6 +83,6 @@ _project_or_flags() { _arguments \ ":command:_commands" \ ":project_or_flags:_project_or_flags" \ - "*::flags:_flags" + "*::flags:_tests_or_flags" return 0