-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
47 lines (40 loc) · 874 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 (
"fmt"
"os"
"time"
"github.com/urfave/cli/v2"
)
var (
// these variables are populated by Goreleaser when releasing
version = "unknown"
commit = "-dirty-"
date = time.Now().Format("2006-01-02")
appName = "provider-minio"
appLongName = "Crossplane provider for Minio"
)
func main() {
app := newApp()
err := app.Run(os.Args)
// If required flags aren't set, it will return with error before we could set up logging
if err != nil {
_, _ = fmt.Fprintf(os.Stderr, "%v\n", err)
os.Exit(1)
}
}
func newApp() *cli.App {
app := &cli.App{
Name: appName,
Usage: appLongName,
Version: fmt.Sprintf("%s, revision=%s, date=%s", version, commit, date),
Before: setupLogging,
Flags: []cli.Flag{
newLogLevelFlag(),
newLogFormatFlag(),
},
Commands: []*cli.Command{
newOperatorCommand(),
},
}
return app
}