Skip to content

Commit

Permalink
deps: update dependency com.github.ajalt.clikt:clikt to v5
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and sschuberth committed Sep 16, 2024
1 parent 085cb11 commit 64e4556
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion cli/src/main/kotlin/ExportCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package dev.schuberth.stan.cli

import com.github.ajalt.clikt.core.BadParameterValue
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.Context
import com.github.ajalt.clikt.core.requireObject
import com.github.ajalt.clikt.parameters.options.convert
import com.github.ajalt.clikt.parameters.options.multiple
Expand All @@ -17,7 +18,9 @@ import dev.schuberth.stan.model.Statement
import java.io.ByteArrayOutputStream
import java.io.FileOutputStream

class ExportCommand : CliktCommand(name = "export", help = "Export statements to different formats.") {
class ExportCommand : CliktCommand("export") {
override fun help(context: Context) = "Export statements to different formats."

private val exportFormats by option(
"--format", "-f",
help = "The data format to export to, must be one of ${Exporter.ALL.keys}. If none is specified only " +
Expand Down
5 changes: 4 additions & 1 deletion cli/src/main/kotlin/FilterCommand.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.schuberth.stan.cli

import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.Context
import com.github.ajalt.clikt.core.requireObject
import com.github.ajalt.clikt.parameters.options.option
import com.github.ajalt.clikt.parameters.types.enum
Expand All @@ -11,7 +12,9 @@ import dev.schuberth.stan.model.joinInfo

import java.time.LocalDate

class FilterCommand : CliktCommand(name = "filter", help = "Filter booking items.") {
class FilterCommand : CliktCommand("filter") {
override fun help(context: Context) = "Filter booking items."

private val from by option(
"--from",
help = "Start date (inclusive), e.g. '2022-09-01'."
Expand Down
5 changes: 4 additions & 1 deletion cli/src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.ProgramResult
import com.github.ajalt.clikt.core.UsageError
import com.github.ajalt.clikt.core.context
import com.github.ajalt.clikt.core.main
import com.github.ajalt.clikt.core.subcommands
import com.github.ajalt.clikt.output.MordantHelpFormatter
import com.github.ajalt.clikt.parameters.arguments.argument
Expand Down Expand Up @@ -34,7 +35,9 @@ import org.koin.dsl.module

fun main(args: Array<String>) = Main().main(args)

class Main : CliktCommand(invokeWithoutSubcommand = true), Logger {
class Main : CliktCommand(), Logger {
override val invokeWithoutSubcommand = true

private val userHome by lazy {
val fixedUserHome = System.getProperty("user.home").takeUnless { it.isBlank() || it == "?" } ?: listOfNotNull(
System.getenv("HOME"),
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kotlinPlugin = "2.0.20"
versionsPlugin = "0.51.0"

bouncyCastle = "1.78.1"
clikt = "4.4.0"
clikt = "5.0.0"
itextpdf = "5.5.13.4"
koinCore = "3.5.6"
kotest = "5.9.1"
Expand Down

0 comments on commit 64e4556

Please sign in to comment.