-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
54 lines (46 loc) · 1014 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
package main
import (
"context"
"log"
"os"
doomsday "github.com/starkandwayne/doomsday-cli/cli"
"github.com/urfave/cli/v2"
)
var (
appVersion = "v0.0.1"
)
func main() {
ctx := context.Background()
app := &cli.App{
Name: "Doomsday API CLI",
Usage: "A tool that helps interact with Doomsday API",
Commands: doomsday.GetCommands(ctx),
Version: appVersion,
Flags: []cli.Flag{
&cli.StringFlag{
Name: "server",
Aliases: []string{"s"},
Value: "https://localhost:443",
Usage: "Doomsday API server URL",
EnvVars: []string{"DOOMSDAY_SERVER"},
},
&cli.StringFlag{
Name: "username",
Aliases: []string{"u"},
Value: "doomsday",
Usage: "API server username",
EnvVars: []string{"DOOMSDAY_USER"},
},
&cli.StringFlag{
Name: "password",
Aliases: []string{"p"},
Usage: "API server password",
EnvVars: []string{"DOOMSDAY_PASSWORD"},
},
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}