-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
47 lines (39 loc) · 788 Bytes
/
main.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
package main
import (
"log"
"os"
"github.com/catsby/vaultstats/commands"
"github.com/mitchellh/cli"
)
func main() {
c := cli.NewCLI("vaultstats", "0.0.1")
c.Args = os.Args[1:]
ui := &cli.ColoredUi{
OutputColor: cli.UiColorNone,
InfoColor: cli.UiColorNone,
ErrorColor: cli.UiColorRed,
WarnColor: cli.UiColorYellow,
Ui: &cli.BasicUi{
Reader: os.Stdin,
Writer: os.Stdout,
ErrorWriter: os.Stderr,
},
}
c.Commands = map[string]cli.CommandFactory{
"stats": func() (cli.Command, error) {
return &commands.StatsCommand{
UI: ui,
}, nil
},
"csv": func() (cli.Command, error) {
return &commands.CSVCommand{
UI: ui,
}, nil
},
}
exitStatus, err := c.Run()
if err != nil {
log.Println(err)
}
os.Exit(exitStatus)
}