libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 4335829a932b10d37647de2375197933f841da6e
parent 9b9ae5d3efc3ba8099734b4392ccf1d8b3bda422
Author: Antoine A <>
Date:   Fri,  9 Feb 2024 15:33:21 +0100

Fix dbconfig script and improve config cli errors

Diffstat:
Mcommon/src/main/kotlin/Cli.kt | 14+++++++-------
Mcontrib/libeufin-dbconfig | 2+-
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/common/src/main/kotlin/Cli.kt b/common/src/main/kotlin/Cli.kt @@ -1,6 +1,6 @@ /* * This file is part of LibEuFin. - * Copyright (C) 2023 Taler Systems S.A. + * Copyright (C) 2023-2024 Taler Systems S.A. * LibEuFin is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -81,22 +81,22 @@ private class CliConfigGet(private val configSource: ConfigSource) : CliktComman "--filename", "-f", help = "Interpret value as path with dollar-expansion" ).flag() - private val sectionName by argument() - private val optionName by argument() + private val section by argument() + private val option by argument() override fun run() = cliCmd(logger, common.log) { val config = configSource.fromFile(common.config) if (isPath) { - val res = config.lookupPath(sectionName, optionName) + val res = config.lookupPath(section, option) if (res == null) { - throw Exception("value not found in config") + throw Exception("option '$option' in section '$section' not found in config") } println(res) } else { - val res = config.lookupString(sectionName, optionName) + val res = config.lookupString(section, option) if (res == null) { - throw Exception("value not found in config") + throw Exception("option '$option' in section '$section' not found in config") } println(res) } diff --git a/contrib/libeufin-dbconfig b/contrib/libeufin-dbconfig @@ -106,7 +106,7 @@ fi # When using this dbconfig script, the libeufin-bank and libeufin-nexus # databases *must* match. -NEXUS_DBPATH=$(libeufin-nexus config get nexus-postgres CONFIG) +NEXUS_DBPATH=$(libeufin-nexus config get nexus-postgres CONFIG | libeufin-nexus config get libeufin-nexusdb-postgres CONFIG) if ! echo "$NEXUS_DBPATH" | grep "postgres://" >/dev/null; then echo "Invalid libeufin-nexus database configuration value '$NEXUS_DBPATH'." 1>&2