added configuration.md

This commit is contained in:
Michael Hoennig
2026-06-09 17:04:07 +02:00
parent 117caf12a9
commit 02b08306e1
6 changed files with 344 additions and 2 deletions
@@ -1,5 +1,6 @@
package de.hoennig.gittally.commands
import de.hoennig.gittally.config.ConfigLoader
import org.springframework.stereotype.Component
import picocli.CommandLine.Command
import picocli.CommandLine.Option
@@ -10,11 +11,22 @@ import picocli.CommandLine.Option
description = ["Print the effective configuration"],
mixinStandardHelpOptions = true,
)
class ConfigPrintCommand : Runnable {
class ConfigPrintCommand(
private val configLoader: ConfigLoader,
) : Runnable {
@Option(names = ["--full"], description = ["Include all defaults"])
var full: Boolean = false
override fun run() {
println("config:print${if (full) " --full" else ""} not yet implemented")
if (full) {
print(configLoader.toYaml(configLoader.load()))
} else {
val raw = configLoader.loadRaw()
if (raw.isEmpty()) {
println("(no configuration files found)")
} else {
print(configLoader.toYaml(raw))
}
}
}
}