-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
42 lines (35 loc) · 1.04 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
package main
import (
"os"
"github.com/alecthomas/kong"
"github.com/aserto-dev/ds-load/cli/pkg/cc"
"github.com/aserto-dev/ds-load/plugins/azuread/pkg/app"
"github.com/aserto-dev/ds-load/sdk/common"
"github.com/aserto-dev/ds-load/sdk/common/kongyaml"
)
func main() {
cli := app.CLI{}
defaultConfigPath := "~/.config/ds-load/cfg/azuread.yaml"
yamlLoader := kongyaml.NewYAMLResolver("azuread")
options := []kong.Option{
kong.Name(app.AppName),
kong.Description(app.AppDescription),
kong.UsageOnError(),
kong.Configuration(yamlLoader.Loader, defaultConfigPath),
kong.ConfigureHelp(kong.HelpOptions{
NoAppSummary: false,
Summary: false,
Compact: true,
Tree: false,
FlagsLast: true,
Indenter: kong.SpaceIndenter,
NoExpandSubcommands: false,
}),
}
ctx := cc.NewCommonContext(cli.Verbosity, string(cli.Config))
kongCtx := kong.Parse(&cli, options...)
if err := kongCtx.Run(ctx); err != nil {
kongCtx.FatalIfErrorf(err)
}
os.Exit(common.GetExitCode())
}