-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
43 lines (36 loc) · 935 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
// Package main for registry
package main
import (
"github.com/alecthomas/kong"
"github.com/postfinance/flash"
"github.com/postfinance/terraform-registry/internal/cmd"
"github.com/zbindenren/king"
)
//nolint:gochecknoglobals // there is no other way to initialize these values
var (
version = "0.0.0"
commit = "12345678"
date string
)
func main() {
l := flash.New(flash.WithColor())
b, err := king.NewBuildInfo(version,
king.WithDateString(date),
king.WithRevision(commit),
)
if err != nil {
l.Fatal(err)
}
cli := cmd.CLI{}
app := kong.Parse(&cli, king.DefaultOptions(
king.Config{
Name: "registry",
Description: "Implements HashiCorp's Provider Registry Protocol for Terraform (see: https://www.terraform.io/docs/internals/provider-registry-protocol.html)",
BuildInfo: b,
},
)...)
l.SetDebug(cli.Debug)
if err := app.Run(&cli.Globals, l.Get()); err != nil {
l.Fatal(err)
}
}