commit 5b1d376ec4e8a50859acf07788e81349e9fdc4ba parent fb48008197b479358a2344c4d4d99c1adac53f87 Author: Antoine A <> Date: Sat, 13 Jul 2024 00:39:26 +0200 common: fix config CLI error msg Diffstat:
| M | common/src/main/kotlin/Cli.kt | | | 12 | +++--------- |
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/common/src/main/kotlin/Cli.kt b/common/src/main/kotlin/Cli.kt @@ -108,17 +108,11 @@ private class CliConfigGet(private val configSource: ConfigSource) : CliktComman override fun run() = cliCmd(logger, common.log) { val config = configSource.fromFile(common.config) - val section = config.section(section) + val sect = config.section(section) if (isPath) { - val res = requireNotNull(section.path(option).orNull()) { - "option '$option' in section '$section' not found in config" - } - println(res) + println(sect.path(option).require()) } else { - val res = requireNotNull(section.string(option).orNull()) { - "option '$option' in section '$section' not found in config" - } - println(res) + println(sect.string(option).require()) } } }