Skip to content

deps: update dependency com.github.ajalt.clikt:clikt to v5 #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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