cmd/loop: parse start_time_ns as int, not string

urfave/cli/v3 returns "" if an int flag is accessed using String getter.
This commit is contained in:
Boris Nagaev 2025-10-07 00:00:50 -03:00
parent e8f5a54b22
commit 5fa5a4e1b8
No known key found for this signature in database

View file

@ -110,11 +110,7 @@ func listSwaps(ctx *cli.Context) error {
// Parse start timestamp if set.
if ctx.IsSet("start_time_ns") {
startTimestamp, err := strconv.ParseInt(ctx.String("start_time_ns"), 10, 64)
if err != nil {
return fmt.Errorf("error parsing start timestamp: %w", err)
}
filter.StartTimestampNs = startTimestamp
filter.StartTimestampNs = ctx.Int64("start_time_ns")
}
resp, err := client.ListSwaps(