From 84b03a6b6199e4f2572e5c88321d018c34f04e00 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Thu, 3 Jul 2025 16:18:12 +0200 Subject: [PATCH 1/4] Add "--version" alias to the version command --- src/main/scala/eu/neverblink/jelly/cli/command/Version.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/eu/neverblink/jelly/cli/command/Version.scala b/src/main/scala/eu/neverblink/jelly/cli/command/Version.scala index c9c75f7..263fce5 100644 --- a/src/main/scala/eu/neverblink/jelly/cli/command/Version.scala +++ b/src/main/scala/eu/neverblink/jelly/cli/command/Version.scala @@ -15,6 +15,7 @@ object Version extends JellyCommand[VersionOptions]: override def names: List[List[String]] = List( List("version"), List("v"), + List("--version"), ) override def doRun(options: VersionOptions, remainingArgs: RemainingArgs): Unit = From 1bf025262e320a6ff86bbb9a5e65f07be5576ef3 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 4 Jul 2025 08:07:37 +0200 Subject: [PATCH 2/4] Add "--version" command test --- .../eu/neverblink/jelly/cli/command/VersionSpec.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala b/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala index 212172b..69253e6 100644 --- a/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala +++ b/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala @@ -12,3 +12,11 @@ class VersionSpec extends AnyWordSpec, Matchers: out should include("Apache Jena") } } + "--version command" should { + "print version" in { + val (out, err) = Version.runTestCommand(List("--version")) + out should startWith("jelly-cli") + out should include("Jelly-JVM") + out should include("Apache Jena") + } + } \ No newline at end of file From d685651645644fa1cee82e9d8099c6669d7939c1 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 4 Jul 2025 08:10:53 +0200 Subject: [PATCH 3/4] Fix formatting --- .../scala/eu/neverblink/jelly/cli/command/VersionSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala b/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala index 69253e6..57c720d 100644 --- a/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala +++ b/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala @@ -19,4 +19,4 @@ class VersionSpec extends AnyWordSpec, Matchers: out should include("Jelly-JVM") out should include("Apache Jena") } - } \ No newline at end of file + } From 8dda2267c775f3bb6b09cf4eaeecf793af0106a8 Mon Sep 17 00:00:00 2001 From: niegrzybkowski Date: Fri, 4 Jul 2025 09:10:18 +0200 Subject: [PATCH 4/4] Parametrize the version command test for all aliases --- .../jelly/cli/command/VersionSpec.scala | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala b/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala index 57c720d..bd3e9b3 100644 --- a/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala +++ b/src/test/scala/eu/neverblink/jelly/cli/command/VersionSpec.scala @@ -4,19 +4,12 @@ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec class VersionSpec extends AnyWordSpec, Matchers: - "version command" should { - "print something" in { - val (out, err) = Version.runTestCommand(List("version")) - out should startWith("jelly-cli") - out should include("Jelly-JVM") - out should include("Apache Jena") + for alias <- Seq("version", "v", "--version") do + s"$alias command" should { + "print something" in { + val (out, err) = Version.runTestCommand(List(alias)) + out should startWith("jelly-cli") + out should include("Jelly-JVM") + out should include("Apache Jena") + } } - } - "--version command" should { - "print version" in { - val (out, err) = Version.runTestCommand(List("--version")) - out should startWith("jelly-cli") - out should include("Jelly-JVM") - out should include("Apache Jena") - } - }