From b5b857ddaa798a67c0fda5ea299ebd5412929fbc Mon Sep 17 00:00:00 2001 Message-ID: In-Reply-To: <65a3529cd76b7b1912561ffd1cae2d6d1514aa18.1766509799.git.h.goebel@crazy-compilers.com> References: <65a3529cd76b7b1912561ffd1cae2d6d1514aa18.1766509799.git.h.goebel@crazy-compilers.com> From: Hartmut Goebel Date: Tue, 23 Dec 2025 17:55:32 +0100 Subject: [PATCH 3/3] wallet-cli: withdrawKudos: Cleanup option handling. --- packages/taler-wallet-cli/src/index.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index 51261b0..29c5966 100644 --- a/packages/taler-wallet-cli/src/index.ts +++ b/packages/taler-wallet-cli/src/index.ts @@ -2035,23 +2035,26 @@ testCli testCli .subcommand("withdrawKudos", "withdraw-kudos") .flag("wait", ["--wait"]) - .maybeOption("amount", ["--amount"], clk.AMOUNT, { + .requiredOption("amount", ["--amount"], clk.AMOUNT, { help: "Amount to withdraw (default: 50 KUDOS)", + default: "KUDOS:50", }) - .maybeOption("bank", ["--bank-url"], clk.STRING, { + .requiredOption("bank", ["--bank-url"], clk.STRING, { help: "Bank to use for operations (default: https://bank.demo.taler.net/).", + default: "https://bank.demo.taler.net/", }) - .maybeOption("exchange", ["--exchange-url"], clk.STRING, { + .requiredOption("exchange", ["--exchange-url"], clk.STRING, { help: "Exchange to use for operations (default: https://exchange.demo.taler.net/).", + default: "https://exchange.demo.taler.net/", }) .action(async (args) => { await withWallet(args, { lazyTaskLoop: true }, async (wallet) => { const resp = await wallet.client.call( WalletApiOperation.WithdrawTestBalance, { - amount: (args.withdrawKudos.amount ?? "KUDOS:50") as AmountString, - corebankApiBaseUrl: (args.withdrawKudos.bank ?? "https://bank.demo.taler.net/"), - exchangeBaseUrl: (args.withdrawKudos.exchange ?? "https://exchange.demo.taler.net/"), + amount: args.withdrawKudos.amount as AmountString, + corebankApiBaseUrl: args.withdrawKudos.bank, + exchangeBaseUrl: args.withdrawKudos.exchange, }, ); if (args.withdrawKudos.wait) { -- 2.41.3