diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 433c926fa..d071040c9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -79,7 +79,7 @@ xmlwriter = "1.0.4" # Tool dependencies betterparse = "0.4.4" -clikt = "4.4.0" +clikt = "5.0.1" icu4j = "76.1" junit-jupiter = "5.11.3" kotlin-logging-jvm = "7.0.0" diff --git a/tools/mklanguages/src/main/kotlin/app/pachli/mklanguages/Main.kt b/tools/mklanguages/src/main/kotlin/app/pachli/mklanguages/Main.kt index fd6675bb3..efb54963a 100644 --- a/tools/mklanguages/src/main/kotlin/app/pachli/mklanguages/Main.kt +++ b/tools/mklanguages/src/main/kotlin/app/pachli/mklanguages/Main.kt @@ -20,7 +20,9 @@ package app.pachli.mklanguages import ch.qos.logback.classic.Level import ch.qos.logback.classic.Logger import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context import com.github.ajalt.clikt.core.UsageError +import com.github.ajalt.clikt.core.main import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import com.github.h0tk3y.betterParse.grammar.parseToEnd @@ -82,9 +84,11 @@ data class Language( * * Run with `gradlew :tools:mklanguages:run` or `runtools mklanguages`. */ -class App : CliktCommand(help = """Update languages in donottranslate.xml""") { +class App : CliktCommand() { private val verbose by option("-n", "--verbose", help = "show additional information").flag() + override fun help(context: Context) = "Update languages in donottranslate.xml" + /** * Returns the full path to the Pachli `.../app/src/main/res` directory, starting from the * given [start] directory, walking up the tree if it can't be found there. diff --git a/tools/mkserverversions/src/main/kotlin/app/pachli/mkserverversions/Main.kt b/tools/mkserverversions/src/main/kotlin/app/pachli/mkserverversions/Main.kt index caa1f2317..9bf8d4128 100644 --- a/tools/mkserverversions/src/main/kotlin/app/pachli/mkserverversions/Main.kt +++ b/tools/mkserverversions/src/main/kotlin/app/pachli/mkserverversions/Main.kt @@ -22,7 +22,9 @@ import ch.qos.logback.classic.Level import ch.qos.logback.classic.Logger import com.apollographql.apollo3.ApolloClient import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context import com.github.ajalt.clikt.core.UsageError +import com.github.ajalt.clikt.core.main import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option import com.squareup.moshi.Moshi @@ -42,9 +44,11 @@ private val log = KotlinLogging.logger {} const val DEST_DIR = "core/network/src/test/resources" -class App : CliktCommand(help = """Update server-versions.json5""") { +class App : CliktCommand() { private val verbose by option("-n", "--verbose", help = "show additional information").flag() + override fun help(context: Context) = "Update server-versions.json5" + /** * Returns the full path to the Pachli `.../core/network/src/test/resources` directory, * starting from the given [start] directory, walking up the tree if it can't be found diff --git a/tools/mvstring/src/main/kotlin/app/pachli/mvstring/Main.kt b/tools/mvstring/src/main/kotlin/app/pachli/mvstring/Main.kt index 658142b26..2e9dce04c 100644 --- a/tools/mvstring/src/main/kotlin/app/pachli/mvstring/Main.kt +++ b/tools/mvstring/src/main/kotlin/app/pachli/mvstring/Main.kt @@ -20,7 +20,9 @@ package app.pachli.mvstring import ch.qos.logback.classic.Level import ch.qos.logback.classic.Logger import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.core.Context import com.github.ajalt.clikt.core.UsageError +import com.github.ajalt.clikt.core.main import com.github.ajalt.clikt.parameters.arguments.argument import com.github.ajalt.clikt.parameters.arguments.multiple import com.github.ajalt.clikt.parameters.options.default @@ -50,13 +52,15 @@ private val log = KotlinLogging.logger {} * * Run with `gradlew :tools:mvstring:run` or `runtools mvstring`. */ -class App : CliktCommand(help = """Move string resources between modules""") { +class App : CliktCommand() { private val args by argument().multiple() private val verbose by option("-v", "--verbose", help = "show additional information").flag() private val srcVariant by option("--srcVariant").default("main") private val dstVariant by option("--dstVariant").default("main") + override fun help(context: Context) = "Move string resources between modules" + /** * Returns the full path to a module's `.../src/main/res` directory, starting from the * given [start] directory, walking up the tree if it can't be found there.