-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
56 lines (49 loc) · 1011 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
48
49
50
51
52
53
54
55
56
package main
import (
"./commands"
"os"
log "github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
var version string
// main function
func main() {
app := cli.NewApp()
app.Name = "dogsitter"
app.HelpName = "CLI tool to import and export Datadog dashboard."
app.Version = version
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "api-key",
Usage: "Datadog API key",
EnvVar: "DATADOG_API_KEY",
},
cli.StringFlag{
Name: "app-key, application-key",
Usage: "Datadog Application key",
EnvVar: "DATADOG_APP_KEY",
},
cli.StringFlag{
Name: "l, log-level",
Usage: "Setting log level",
EnvVar: "DS_LOGLEVEL",
Value: "INFO",
},
cli.StringFlag{
Name: "dh, datadog-host",
Usage: "Datadog endpoint",
EnvVar: "DD_HOST",
Value: "https://app.datadoghq.eu",
},
}
app.Commands = []cli.Command{
commands.DeleteCmd,
commands.ListCmd,
commands.PullCmd,
commands.PushCmd,
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}