cmd/XDC: fix some cli parsing issues (#25234)

This commit is contained in:
Daniel Liu 2024-11-25 16:39:29 +08:00
parent 369d69649f
commit 3e1ea87ca2
2 changed files with 8 additions and 1 deletions

View file

@ -111,7 +111,10 @@ func localConsole(ctx *cli.Context) error {
// remoteConsole will connect to a remote XDC instance, attaching a JavaScript
// console to it.
func remoteConsole(ctx *cli.Context) error {
// Attach to a remotely running XDC instance and start the JavaScript console
if ctx.Args().Len() > 1 {
utils.Fatalf("invalid command-line: too many arguments")
}
endpoint := ctx.Args().First()
if endpoint == "" {
path := node.DefaultDataDir()

View file

@ -70,6 +70,10 @@ func MigrateGlobalFlags(ctx *cli.Context) {
// This iterates over all commands and wraps their action function.
iterate(ctx.App.Commands, func(cmd *cli.Command) {
if cmd.Action == nil {
return
}
action := cmd.Action
cmd.Action = func(ctx *cli.Context) error {
doMigrateFlags(ctx)