-
Notifications
You must be signed in to change notification settings - Fork 24
/
main.go
45 lines (39 loc) · 1.02 KB
/
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
package main
import (
"context"
"os"
"os/signal"
"strconv"
"github.com/alecthomas/kong"
"github.com/aserto-dev/topaz/cmd/topaz-db/cmd"
)
func main() {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
defer stop()
cli := cmd.CLI{}
kongCtx := kong.Parse(&cli,
kong.Name("topaz-db"),
kong.Description("topaz database utility"),
kong.UsageOnError(),
kong.ConfigureHelp(kong.HelpOptions{
NoAppSummary: false,
Summary: false,
Compact: true,
Tree: false,
FlagsLast: true,
Indenter: kong.SpaceIndenter,
NoExpandSubcommands: true,
}),
kong.Vars{
"directory_svc": os.Getenv("TOPAZ_DIRECTORY_SVC"),
"directory_key": os.Getenv("TOPAZ_DIRECTORY_KEY"),
"directory_token": "",
"tenant_id": os.Getenv("ASERTO_TENANT_ID"),
"insecure": strconv.FormatBool(false),
"no_check": strconv.FormatBool(false),
},
)
if err := kongCtx.Run(ctx); err != nil {
kongCtx.FatalIfErrorf(err)
}
}