/
root.go
62 lines (47 loc) · 1.75 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
____ _ _ _____ _ _
/ __ \ | | | | | __ \ | | | |
| | | |_ __ ___| | ___ __| | __ _ ___ _ __ | |__) | __ ___ | |_ ___ ___ ___ | |
| | | | '_ \ / _ \ | / _ \/ _` |/ _` |/ _ \ '__| | ___/ '__/ _ \| __/ _ \ / __/ _ \| |
| |__| | | | | __/ |___| __/ (_| | (_| | __/ | | | | | | (_) | || (_) | (_| (_) | |
\____/|_| |_|\___|______\___|\__,_|\__, |\___|_| |_| |_| \___/ \__\___/ \___\___/|_|
__/ |
|___/
Copyright 2017 - 2019 OneLedger
*/
package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var RootCmd = &cobra.Command{
Use: "olclient",
Short: "OneLedger client",
Long: "Client access to the OneLedger chain",
}
var rootArgs = rootArguments{}
type rootArguments struct {
rootDir string
}
// Initialize Cobra, config global arguments
func init() {
RootCmd.PersistentFlags().StringVar(&rootArgs.rootDir, "root",
"./", "Set root directory")
/*
RootCmd.PersistentFlags().StringVar(&global.Current.NodeName, "node",
global.Current.NodeName, "Set a node name")
RootCmd.PersistentFlags().BoolVarP(&global.Current.Debug, "debug", "d",
global.Current.Debug, "Set DEBUG mode")
RootCmd.PersistentFlags().StringVarP(&global.Current.Config.Network.RPCAddress, "address", "a",
global.Current.Config.Network.RPCAddress, "full address")
RootCmd.PersistentFlags().StringVar(&global.Current.Config.Network.SDKAddress, "sdkrpc",
global.Current.Config.Network.SDKAddress, "SDK address")
*/
}
func Execute() {
if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(-1)
}
}