-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.go
More file actions
48 lines (41 loc) · 813 Bytes
/
Copy pathmain.go
File metadata and controls
48 lines (41 loc) · 813 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 (
"log"
"os"
"github.com/jakolehm/trieres/cmd"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
)
// VERSION gets overridden at build time using -X main.VERSION=$VERSION
var VERSION = "dev"
func init() {
logrus.SetOutput(os.Stdout)
logrus.SetLevel(logrus.InfoLevel)
}
func main() {
app := &cli.App{
Name: "trieres",
Version: VERSION,
Usage: "k3s cluster lifecycle management tool",
Commands: []*cli.Command{
cmd.UpCommand(),
cmd.KubeconfigCommand(),
},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "debug,d",
Usage: "Debug logging",
},
},
Before: func(ctx *cli.Context) error {
if ctx.Bool("debug") {
logrus.SetLevel(logrus.DebugLevel)
}
return nil
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}