add test-library and ktlint
This commit is contained in:
@@ -1,22 +1,32 @@
|
||||
package de.hoennig.gittally
|
||||
|
||||
import org.springframework.boot.CommandLineRunner
|
||||
import org.springframework.boot.ExitCodeGenerator
|
||||
import org.springframework.boot.SpringApplication
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||
import org.springframework.boot.runApplication
|
||||
import org.springframework.stereotype.Component
|
||||
import picocli.CommandLine
|
||||
import picocli.CommandLine.IFactory
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
@SpringBootApplication
|
||||
class GitTallyApplication(
|
||||
class GitTallyApplication
|
||||
|
||||
@Component
|
||||
class CliRunner(
|
||||
private val factory: IFactory,
|
||||
private val rootCommand: GitTallyCommand,
|
||||
) : CommandLineRunner {
|
||||
) : CommandLineRunner, ExitCodeGenerator {
|
||||
private var exitCode = 0
|
||||
|
||||
override fun run(vararg args: String) {
|
||||
exitProcess(CommandLine(rootCommand, factory).execute(*args))
|
||||
exitCode = CommandLine(rootCommand, factory).execute(*args)
|
||||
}
|
||||
|
||||
override fun getExitCode() = exitCode
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
runApplication<GitTallyApplication>(*args)
|
||||
exitProcess(SpringApplication.exit(runApplication<GitTallyApplication>(*args)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user