Skip to content

Commit

Permalink
Update dependency com.github.ajalt.clikt:clikt to v5 (#201)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Sep 18, 2024
1 parent a2c415d commit b888cec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ xmlutil-serialization = { module = "io.github.pdvrieze.xmlutil:serialization", v

mordant = "com.github.ajalt.mordant:mordant:2.7.2"
tomlj = "org.tomlj:tomlj:1.1.1"
clikt = "com.github.ajalt.clikt:clikt:4.4.0"
clikt = "com.github.ajalt.clikt:clikt:5.0.0"

junit = "junit:junit:4.13.2"
truth = "com.google.truth:truth:1.4.4"
Expand Down
24 changes: 11 additions & 13 deletions src/main/kotlin/watch/dependency/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
package watch.dependency

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.Context
import com.github.ajalt.clikt.core.NoOpCliktCommand
import com.github.ajalt.clikt.core.main
import com.github.ajalt.clikt.core.subcommands
import com.github.ajalt.clikt.parameters.arguments.argument
import com.github.ajalt.clikt.parameters.arguments.help
Expand Down Expand Up @@ -39,10 +41,7 @@ fun main(vararg args: String) {
.main(args)
}

private abstract class DependencyWatchCommand(
name: String,
help: String = "",
) : CliktCommand(name = name, help = help) {
private abstract class DependencyWatchCommand(name: String) : CliktCommand(name) {
protected val debug by option(hidden = true)
.switch<Debug>(mapOf("--debug" to Debug.Console))
.default(Debug.Disabled)
Expand Down Expand Up @@ -108,11 +107,10 @@ private abstract class DependencyWatchCommand(
)
}

private class AwaitCommand :
DependencyWatchCommand(
name = "await",
help = "Wait for an artifact to appear in a Maven repository then exit",
) {
private class AwaitCommand : DependencyWatchCommand("await") {
override fun help(context: Context) =
"Wait for an artifact to appear in a Maven repository then exit"

private val repo by option("--repo", metavar = "URL")
.help(
"""
Expand Down Expand Up @@ -156,10 +154,10 @@ private class AwaitCommand :

private class NotifyCommand(
fs: FileSystem,
) : DependencyWatchCommand(
name = "notify",
help = "Monitor Maven coordinates in a Maven repository for new versions",
) {
) : DependencyWatchCommand("notify") {
override fun help(context: Context) =
"Monitor Maven coordinates in a Maven repository for new versions"

private val configPath by argument("CONFIG")
.help(
"""
Expand Down

0 comments on commit b888cec

Please sign in to comment.