-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
48 lines (36 loc) · 719 Bytes
/
main.go
File metadata and controls
48 lines (36 loc) · 719 Bytes
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
package main
import (
"os"
cliTool "github.com/mitchellh/cli"
"github.com/techmesh/dotam/cli"
log "github.com/sirupsen/logrus"
)
func init() {
initLogLevel()
}
func initLogLevel() {
level := os.Getenv("LOG_LEVEL")
if level != "debug" {
log.SetLevel(log.InfoLevel)
} else {
log.SetLevel(log.DebugLevel)
}
log.SetFormatter(&log.TextFormatter{})
log.SetOutput(os.Stdout)
}
func main() {
initCli()
}
func initCli() {
c := cliTool.NewCLI("dotam", string(RELEASE_VERSION))
c.Args = os.Args[1:]
c.Commands = map[string]cliTool.CommandFactory{
"build": cli.BuildCMDFactor,
"init": cli.InitCMDFactor,
}
exitStatus, err := c.Run()
if err != nil {
log.Error(err)
}
os.Exit(exitStatus)
}