diff --git a/cmd/XDC/config.go b/cmd/XDC/config.go index 0292df0278..38ff730bdf 100644 --- a/cmd/XDC/config.go +++ b/cmd/XDC/config.go @@ -24,6 +24,7 @@ import ( "math/big" "os" "reflect" + "slices" "strings" "unicode" @@ -49,7 +50,7 @@ var ( Name: "dumpconfig", Usage: "Show configuration values", ArgsUsage: "", - Flags: utils.GroupFlags(nodeFlags, rpcFlags), + Flags: slices.Concat(nodeFlags, rpcFlags), Description: `The dumpconfig command shows configuration values.`, } diff --git a/cmd/XDC/consolecmd.go b/cmd/XDC/consolecmd.go index f6b0630293..8fb64a99c9 100644 --- a/cmd/XDC/consolecmd.go +++ b/cmd/XDC/consolecmd.go @@ -21,6 +21,7 @@ import ( "os" "os/signal" "path/filepath" + "slices" "strings" "syscall" @@ -38,7 +39,7 @@ var ( Action: localConsole, Name: "console", Usage: "Start an interactive JavaScript environment", - Flags: utils.GroupFlags(nodeFlags, rpcFlags, consoleFlags), + Flags: slices.Concat(nodeFlags, rpcFlags, consoleFlags), Description: ` The XDC console is an interactive shell for the JavaScript runtime environment which exposes a node admin interface as well as the Ðapp JavaScript API. @@ -50,7 +51,7 @@ See https://github.com/XinFinOrg/XDPoSChain/wiki/JavaScript-Console.`, Name: "attach", Usage: "Start an interactive JavaScript environment (connect to node)", ArgsUsage: "[endpoint]", - Flags: utils.GroupFlags([]cli.Flag{utils.DataDirFlag}, consoleFlags), + Flags: slices.Concat([]cli.Flag{utils.DataDirFlag}, consoleFlags), Description: ` The XDC console is an interactive shell for the JavaScript runtime environment which exposes a node admin interface as well as the Ðapp JavaScript API. @@ -63,7 +64,7 @@ This command allows to open a console on a running XDC node.`, Name: "js", Usage: "Execute the specified JavaScript files", ArgsUsage: " [jsfile...]", - Flags: utils.GroupFlags(nodeFlags, consoleFlags), + Flags: slices.Concat(nodeFlags, consoleFlags), Description: ` The JavaScript VM exposes a node admin interface as well as the Ðapp JavaScript API. See https://github.com/XinFinOrg/XDPoSChain/wiki/JavaScript-Console`, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 3b1905edbc..4be3e939bd 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -816,15 +816,6 @@ var ( } ) -// GroupFlags combines the given flag slices together and returns the merged one. -func GroupFlags(groups ...[]cli.Flag) []cli.Flag { - var ret []cli.Flag - for _, group := range groups { - ret = append(ret, group...) - } - return ret -} - // MakeDataDir retrieves the currently requested data directory, terminating // if none (or the empty string) is specified. If the node is starting a testnet, // the a subdirectory of the specified datadir will be used.