mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
cmd/loop: parse --amt as int, not as string
urfave/cli/v3 returns "" if an int flag is accessed using String getter.
This commit is contained in:
parent
dfb16df6ad
commit
ea9f902de2
2 changed files with 3 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/lightninglabs/loop"
|
||||
"github.com/lightninglabs/loop/labels"
|
||||
|
|
@ -94,7 +95,7 @@ func loopIn(ctx *cli.Context) error {
|
|||
var amtStr string
|
||||
switch {
|
||||
case ctx.IsSet("amt"):
|
||||
amtStr = ctx.String("amt")
|
||||
amtStr = strconv.FormatUint(ctx.Uint64("amt"), 10)
|
||||
case ctx.NArg() == 1:
|
||||
amtStr = args[0]
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ func loopOut(ctx *cli.Context) error {
|
|||
var amtStr string
|
||||
switch {
|
||||
case ctx.IsSet("amt"):
|
||||
amtStr = ctx.String("amt")
|
||||
amtStr = strconv.FormatUint(ctx.Uint64("amt"), 10)
|
||||
case ctx.NArg() == 1 || ctx.NArg() == 2:
|
||||
amtStr = args[0]
|
||||
args = args.Tail()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue