headless wallet: add parameters for test-withdraw subcommand

This commit is contained in:
Florian Dold 2019-09-13 02:04:38 +02:00
parent 4b8b967e58
commit 36a4a6218c
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -51,14 +51,21 @@ function applyVerbose(verbose: boolean) {
program program
.command("test-withdraw") .command("test-withdraw")
.option(
"-e, --exchange <exchange-url>",
"exchange base URL",
"https://exchange.test.taler.net/",
)
.option("-a, --amount <withdraw-amt>", "amount to withdraw", "TESTKUDOS:10")
.option("-b, --bank <bank-url>", "bank base URL", "https://bank.test.taler.net/")
.description("withdraw test currency from the test bank") .description("withdraw test currency from the test bank")
.action(async () => { .action(async cmdObj => {
applyVerbose(program.verbose); applyVerbose(program.verbose);
console.log("test-withdraw command called"); console.log("test-withdraw command called");
const wallet = await getDefaultNodeWallet({ const wallet = await getDefaultNodeWallet({
persistentStoragePath: walletDbPath, persistentStoragePath: walletDbPath,
}); });
await withdrawTestBalance(wallet); await withdrawTestBalance(wallet, cmdObj.amount, cmdObj.bank, cmdObj.exchange);
process.exit(0); process.exit(0);
}); });