From 60aa3bc38dc54d1ec7a39b9243b34d697e947a37 Mon Sep 17 00:00:00 2001 From: jvican Date: Tue, 27 Mar 2018 15:02:42 +0200 Subject: [PATCH] Rename `--filter` to `--only` | `-o` Fixes https://github.com/scalacenter/bloop/issues/327. --- frontend/src/main/scala/bloop/cli/Commands.scala | 6 +++--- frontend/src/main/scala/bloop/engine/Interpreter.scala | 2 +- frontend/src/test/scala/bloop/testing/TestFilterSpec.scala | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/main/scala/bloop/cli/Commands.scala b/frontend/src/main/scala/bloop/cli/Commands.scala index 37c94100d2..eb67be5260 100644 --- a/frontend/src/main/scala/bloop/cli/Commands.scala +++ b/frontend/src/main/scala/bloop/cli/Commands.scala @@ -109,9 +109,9 @@ object Commands { project: String = "", @HelpMessage("Do not run tests for dependencies. By default, false.") isolated: Boolean = false, - @ExtraName("f") - @HelpMessage("One or more filters to run only selected test suites.") - filter: List[String] = Nil, + @ExtraName("o") + @HelpMessage("The list of test suite filters to test for only.") + only: List[String] = Nil, @HelpMessage("Pick reporter to show compilation messages. By default, bloop's used.") reporter: ReporterKind = BloopReporter, @ExtraName("w") diff --git a/frontend/src/main/scala/bloop/engine/Interpreter.scala b/frontend/src/main/scala/bloop/engine/Interpreter.scala index ff819c7972..40f6bb908a 100644 --- a/frontend/src/main/scala/bloop/engine/Interpreter.scala +++ b/frontend/src/main/scala/bloop/engine/Interpreter.scala @@ -178,7 +178,7 @@ object Interpreter { Tasks.pickTestProject(cmd.project, state) match { case Some(project) => def doTest(state: State): Task[State] = { - val testFilter = TestInternals.parseFilters(cmd.filter) + val testFilter = TestInternals.parseFilters(cmd.only) val cwd = cmd.cliOptions.common.workingPath compileAnd(state, project, reporterConfig, excludeRoot = false) { state => diff --git a/frontend/src/test/scala/bloop/testing/TestFilterSpec.scala b/frontend/src/test/scala/bloop/testing/TestFilterSpec.scala index 9bb79ff89c..0abc73e9b5 100644 --- a/frontend/src/test/scala/bloop/testing/TestFilterSpec.scala +++ b/frontend/src/test/scala/bloop/testing/TestFilterSpec.scala @@ -99,7 +99,7 @@ class TestFilterSpec { val projectName = "with-tests" val testName = "hello.ScalaTestTest" val state = ProjectHelpers.loadTestProject(projectName).copy(logger = logger) - val command = Run(Commands.Test(projectName, filter = testName :: Nil)) + val command = Run(Commands.Test(projectName, only = testName :: Nil)) val newState = Interpreter.execute(command, state) assertTrue("Test execution failed.", newState.status.isOk) val messages = logger.getMessages @@ -119,7 +119,7 @@ class TestFilterSpec { val testName = "hello.ScalaTestTest" val exclusionFilter = s"-$testName" val state = ProjectHelpers.loadTestProject(projectName).copy(logger = logger) - val command = Run(Commands.Test(projectName, filter = exclusionFilter :: Nil)) + val command = Run(Commands.Test(projectName, only = exclusionFilter :: Nil)) val newState = Interpreter.execute(command, state) assertTrue("Test execution failed.", newState.status.isOk) val messages = logger.getMessages @@ -140,7 +140,7 @@ class TestFilterSpec { val inclusionFilter = "hello.*a*" val state = ProjectHelpers.loadTestProject(projectName).copy(logger = logger) val command = Run( - Commands.Test(projectName, filter = exclusionFilter :: inclusionFilter :: Nil)) + Commands.Test(projectName, only = exclusionFilter :: inclusionFilter :: Nil)) val newState = Interpreter.execute(command, state) assertTrue("Test execution failed.", newState.status.isOk) val messages = logger.getMessages