forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.go
42 lines (34 loc) · 815 Bytes
/
root.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"context"
"os"
"github.com/gnolang/gno/tm2/pkg/commands"
"github.com/peterbourgon/ff/v3"
"github.com/peterbourgon/ff/v3/fftoml"
)
const flagConfigFlag = "flag-config-path"
func main() {
cmd := newRootCmd(commands.NewDefaultIO())
cmd.Execute(context.Background(), os.Args[1:])
}
func newRootCmd(io commands.IO) *commands.Command {
cmd := commands.NewCommand(
commands.Metadata{
ShortUsage: "<subcommand> [flags] [<arg>...]",
ShortHelp: "starts the gnoland blockchain node",
Options: []ff.Option{
ff.WithConfigFileFlag(flagConfigFlag),
ff.WithConfigFileParser(fftoml.Parser),
},
},
commands.NewEmptyConfig(),
commands.HelpExec,
)
cmd.AddSubCommands(
newStartCmd(io),
newGenesisCmd(io),
newSecretsCmd(io),
newConfigCmd(io),
)
return cmd
}