package main
import (
"context"
"fmt"
"os"
"github.com/urfave/cli/v3"
)
func main() {
app := &cli.Command{
Name: "testcli",
Version: "1.0.0",
HideHelp: true,
Usage: "Call RPC methods from console",
UsageText: "testcli method [args]",
EnableShellCompletion: true,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "help",
Aliases: []string{"h"},
Usage: "show help",
},
&cli.StringFlag{
Name: "wallet",
Aliases: []string{"w"},
Usage: "specify wallet",
Required: false,
},
},
Action: func(ctx context.Context, cmd *cli.Command) error {
fmt.Println(cmd.Args())
return nil
},
}
if err := app.Run(context.Background(), os.Args); err != nil {
fmt.Println(err)
}
}
Hi! Using the latest released urfave/cli v3.0.0-beta1, I get a different behaviour from v2
V2:
V3:
I rely on unknown flags parsing to parse all by-name arguments to external JSONRPC server. There's SkipFlagParsing but it seems to disable all functionality in general
Is there some way to allow to parse unknown flags in Action still?
Attaching example code to test in V2 and V3
V2 code
V3 code