forked from DNAProject/DNA
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nodectl.go
53 lines (48 loc) · 1 KB
/
nodectl.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
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"os"
"sort"
_ "DNA/cli"
"DNA/cli/asset"
"DNA/cli/bookkeeper"
. "DNA/cli/common"
"DNA/cli/data"
"DNA/cli/debug"
"DNA/cli/info"
"DNA/cli/privpayload"
"DNA/cli/smartcontract"
"DNA/cli/test"
"DNA/cli/wallet"
"github.com/urfave/cli"
)
var Version string
func main() {
app := cli.NewApp()
app.Name = "nodectl"
app.Version = Version
app.HelpName = "nodectl"
app.Usage = "command line tool for DNA blockchain"
app.UsageText = "nodectl [global options] command [command options] [args]"
app.HideHelp = false
app.HideVersion = false
//global options
app.Flags = []cli.Flag{
NewIpFlag(),
NewPortFlag(),
}
//commands
app.Commands = []cli.Command{
*debug.NewCommand(),
*info.NewCommand(),
*test.NewCommand(),
*wallet.NewCommand(),
*asset.NewCommand(),
*privpayload.NewCommand(),
*data.NewCommand(),
*bookkeeper.NewCommand(),
*smartcontract.NewCommand(),
}
sort.Sort(cli.CommandsByName(app.Commands))
sort.Sort(cli.FlagsByName(app.Flags))
app.Run(os.Args)
}