diff options
author | Florian Dold <florian@dold.me> | 2023-08-25 11:53:06 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-08-25 11:53:06 +0200 |
commit | 896841aec5dc3594d83cc300349d20ec2270f88e (patch) | |
tree | 8878d728b71823a20940aed53a8c79353dbc5475 /packages/taler-harness/src | |
parent | 3d6cff9c8400c2b5d1b5a0ce149656801b2300fe (diff) | |
download | wallet-core-896841aec5dc3594d83cc300349d20ec2270f88e.tar.xz |
taler-util: set [PATH] defaults
Diffstat (limited to 'packages/taler-harness/src')
-rw-r--r-- | packages/taler-harness/src/index.ts | 33 |
1 files changed, 33 insertions, 0 deletions
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.", }); |