Skip to content

Commit

Permalink
cmd/XDC: fix some cli parsing issues (ethereum#25234)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Nov 25, 2024
1 parent 369d696 commit 3e1ea87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/XDC/consolecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions internal/flags/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3e1ea87

Please sign in to comment.