mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
cmd: use slices.Concat instead of GroupFlags
This commit is contained in:
parent
9b7d0c20e7
commit
2fb9e99ba3
3 changed files with 6 additions and 13 deletions
|
|
@ -24,6 +24,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
|
|
@ -49,7 +50,7 @@ var (
|
||||||
Name: "dumpconfig",
|
Name: "dumpconfig",
|
||||||
Usage: "Show configuration values",
|
Usage: "Show configuration values",
|
||||||
ArgsUsage: "",
|
ArgsUsage: "",
|
||||||
Flags: utils.GroupFlags(nodeFlags, rpcFlags),
|
Flags: slices.Concat(nodeFlags, rpcFlags),
|
||||||
Description: `The dumpconfig command shows configuration values.`,
|
Description: `The dumpconfig command shows configuration values.`,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
|
@ -38,7 +39,7 @@ var (
|
||||||
Action: localConsole,
|
Action: localConsole,
|
||||||
Name: "console",
|
Name: "console",
|
||||||
Usage: "Start an interactive JavaScript environment",
|
Usage: "Start an interactive JavaScript environment",
|
||||||
Flags: utils.GroupFlags(nodeFlags, rpcFlags, consoleFlags),
|
Flags: slices.Concat(nodeFlags, rpcFlags, consoleFlags),
|
||||||
Description: `
|
Description: `
|
||||||
The XDC console is an interactive shell for the JavaScript runtime environment
|
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.
|
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",
|
Name: "attach",
|
||||||
Usage: "Start an interactive JavaScript environment (connect to node)",
|
Usage: "Start an interactive JavaScript environment (connect to node)",
|
||||||
ArgsUsage: "[endpoint]",
|
ArgsUsage: "[endpoint]",
|
||||||
Flags: utils.GroupFlags([]cli.Flag{utils.DataDirFlag}, consoleFlags),
|
Flags: slices.Concat([]cli.Flag{utils.DataDirFlag}, consoleFlags),
|
||||||
Description: `
|
Description: `
|
||||||
The XDC console is an interactive shell for the JavaScript runtime environment
|
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.
|
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",
|
Name: "js",
|
||||||
Usage: "Execute the specified JavaScript files",
|
Usage: "Execute the specified JavaScript files",
|
||||||
ArgsUsage: "<jsfile> [jsfile...]",
|
ArgsUsage: "<jsfile> [jsfile...]",
|
||||||
Flags: utils.GroupFlags(nodeFlags, consoleFlags),
|
Flags: slices.Concat(nodeFlags, consoleFlags),
|
||||||
Description: `
|
Description: `
|
||||||
The JavaScript VM exposes a node admin interface as well as the Ðapp
|
The JavaScript VM exposes a node admin interface as well as the Ðapp
|
||||||
JavaScript API. See https://github.com/XinFinOrg/XDPoSChain/wiki/JavaScript-Console`,
|
JavaScript API. See https://github.com/XinFinOrg/XDPoSChain/wiki/JavaScript-Console`,
|
||||||
|
|
|
||||||
|
|
@ -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
|
// MakeDataDir retrieves the currently requested data directory, terminating
|
||||||
// if none (or the empty string) is specified. If the node is starting a testnet,
|
// 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.
|
// the a subdirectory of the specified datadir will be used.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue