mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-08 14:04:29 +00:00
cmd/XDC: fix some cli parsing issues (#25234)
This commit is contained in:
parent
369d69649f
commit
3e1ea87ca2
2 changed files with 8 additions and 1 deletions
|
|
@ -111,7 +111,10 @@ func localConsole(ctx *cli.Context) error {
|
||||||
// remoteConsole will connect to a remote XDC instance, attaching a JavaScript
|
// remoteConsole will connect to a remote XDC instance, attaching a JavaScript
|
||||||
// console to it.
|
// console to it.
|
||||||
func remoteConsole(ctx *cli.Context) error {
|
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()
|
endpoint := ctx.Args().First()
|
||||||
if endpoint == "" {
|
if endpoint == "" {
|
||||||
path := node.DefaultDataDir()
|
path := node.DefaultDataDir()
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,10 @@ func MigrateGlobalFlags(ctx *cli.Context) {
|
||||||
|
|
||||||
// This iterates over all commands and wraps their action function.
|
// This iterates over all commands and wraps their action function.
|
||||||
iterate(ctx.App.Commands, func(cmd *cli.Command) {
|
iterate(ctx.App.Commands, func(cmd *cli.Command) {
|
||||||
|
if cmd.Action == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
action := cmd.Action
|
action := cmd.Action
|
||||||
cmd.Action = func(ctx *cli.Context) error {
|
cmd.Action = func(ctx *cli.Context) error {
|
||||||
doMigrateFlags(ctx)
|
doMigrateFlags(ctx)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue