Bump clikt to 5.0.3 (#947)

This bumps Clikt from version 3 to version 5, which, among other things, improves
the help text formatting with colors.

Also: 
* Add `--version` flag to pkldoc, pkl-codegen-java, pkl-codegen-kotlin
* Add help text to pkldoc, pkl-codegen-java, pkl-codegen-kotlin
This commit is contained in:
Artem Yarmoliuk authored and GitHub committed 2025-02-19 15:18:02 -08:00
1 parent 643c6f5a76
commit 50cfb1c962
46 files changed
+461 -226

No files matched your search

@@ -17,6 +17,7 @@ package org.pkl.commons.cli
import com.github.ajalt.clikt.core.BadParameterValue
import com.github.ajalt.clikt.core.PrintHelpMessage
import com.github.ajalt.clikt.core.parse
import java.io.File
import java.nio.file.Path
import java.util.regex.Pattern
@@ -31,12 +32,14 @@ class BaseCommandTest {
private val cmd =
object : BaseCommand("test", "") {
override fun run() = Unit
override val helpString: String = ""
}
@Test
fun `invalid timeout`() {
val e = assertThrows<BadParameterValue> { cmd.parse(arrayOf("--timeout", "abc")) }
assertThat(e).hasMessageContaining("timeout")
assertThat(e.message).isEqualTo("abc is not a valid integer")
}
@Test
@@ -15,6 +15,7 @@
*/
package org.pkl.commons.cli
import com.github.ajalt.clikt.core.parse
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.pkl.commons.cli.commands.BaseCommand
@@ -32,6 +33,8 @@ class CliCommandTest {
private val cmd =
object : BaseCommand("test", "") {
override fun run() = Unit
override val helpString: String = ""
}
@Test