-
Notifications
You must be signed in to change notification settings - Fork 4
/
root.go
40 lines (32 loc) · 1.03 KB
/
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
package commands
import (
"github.com/mosaicnetworks/monetd/cmd/giverny/commands/keys"
"github.com/mosaicnetworks/monetd/cmd/giverny/commands/network"
"github.com/mosaicnetworks/monetd/cmd/giverny/commands/parse"
"github.com/mosaicnetworks/monetd/cmd/giverny/commands/transactions"
"github.com/mosaicnetworks/monetd/src/common"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
//RootCmd is the root command for giverny
var RootCmd = &cobra.Command{
Use: "giverny",
Short: "Giverny",
Long: `Giverny
Giverny is the swiss army knife of advanced tools for the Monet Hub. For most users,
you should not need to use this command. The inbuild commands in monetd will suffice for
most use cases.`,
}
func init() {
RootCmd.AddCommand(
keys.KeysCmd,
network.NetworkCmd,
transactions.TransCmd,
parse.ParseCmd,
VersionCmd,
)
//do not print usage when error occurs
RootCmd.SilenceUsage = true
RootCmd.PersistentFlags().BoolVarP(&common.VerboseLogging, "verbose", "v", false, "verbose messages")
viper.BindPFlags(RootCmd.Flags())
}