Skip to content

Commit 74b2e34

Browse files
committed
cmd: positional amount flag for staticaddr loop-in
1 parent 6899bce commit 74b2e34

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

cmd/loop/staticaddr.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,20 @@ func staticAddressLoopIn(ctx *cli.Context) error {
506506
return cli.ShowCommandHelp(ctx, "in")
507507
}
508508

509+
var selectedAmount int64
510+
if ctx.NArg() == 1 {
511+
amt, err := parseAmt(ctx.Args().Get(0))
512+
if err != nil {
513+
return err
514+
}
515+
selectedAmount = int64(amt)
516+
} else if ctx.NArg() > 1 {
517+
return fmt.Errorf("only a single positional argument is " +
518+
"allowed")
519+
} else {
520+
selectedAmount = ctx.Int64("amount")
521+
}
522+
509523
client, cleanup, err := getClient(ctx)
510524
if err != nil {
511525
return err
@@ -516,7 +530,6 @@ func staticAddressLoopIn(ctx *cli.Context) error {
516530
ctxb = context.Background()
517531
isAllSelected = ctx.IsSet("all")
518532
isUtxoSelected = ctx.IsSet("utxo")
519-
selectedAmount = ctx.Int64("amount")
520533
autoSelectDepositsForQuote bool
521534
label = ctx.String("static-loop-in")
522535
hints []*swapserverrpc.RouteHint

0 commit comments

Comments
 (0)