From 896841aec5dc3594d83cc300349d20ec2270f88e Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 25 Aug 2023 11:53:06 +0200 Subject: taler-util: set [PATH] defaults --- packages/taler-harness/src/index.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'packages/taler-harness') diff --git a/packages/taler-harness/src/index.ts b/packages/taler-harness/src/index.ts index a172bc9da..841e17dc7 100644 --- a/packages/taler-harness/src/index.ts +++ b/packages/taler-harness/src/index.ts @@ -170,6 +170,39 @@ const sandcastleCli = testingCli.subcommand("sandcastleArgs", "sandcastle", { help: "Subcommands for handling GNU Taler sandcastle deployments.", }); +const configCli = testingCli.subcommand("configArgs", "config", { + help: "Subcommands for handling the Taler configuration.", +}); + +configCli.subcommand("show", "show").action(async (args) => { + const config = Configuration.load(); + const cfgStr = config.stringify({ + diagnostics: true, + }); + console.log(cfgStr); +}); + +configCli + .subcommand("get", "get") + .requiredArgument("section", clk.STRING) + .requiredArgument("option", clk.STRING) + .flag("file", ["-f"]) + .action(async (args) => { + const config = Configuration.load(); + let res; + if (args.get.file) { + res = config.getString(args.get.section, args.get.option); + } else { + res = config.getPath(args.get.section, args.get.option); + } + if (res.isDefined()) { + console.log(res.value); + } else { + console.warn("not found"); + process.exit(1); + } + }); + const deploymentCli = testingCli.subcommand("deploymentArgs", "deployment", { help: "Subcommands for handling GNU Taler deployments.", }); -- cgit v1.2.3