-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
44 lines (36 loc) · 814 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
package main
import (
"fmt"
"os"
"github.com/bflad/tfproviderdocs/command"
"github.com/bflad/tfproviderdocs/version"
"github.com/mattn/go-colorable"
"github.com/mitchellh/cli"
)
const (
Name = `tfproviderdocs`
)
func main() {
ui := &cli.ColoredUi{
ErrorColor: cli.UiColorRed,
WarnColor: cli.UiColorYellow,
InfoColor: cli.UiColorGreen,
Ui: &cli.BasicUi{
Reader: os.Stdin,
Writer: colorable.NewColorableStdout(),
ErrorWriter: colorable.NewColorableStderr(),
},
}
c := &cli.CLI{
Name: Name,
Version: version.GetVersion().FullVersionNumber(true),
Args: os.Args[1:],
Commands: command.Commands(ui),
}
exitStatus, err := c.Run()
if err != nil {
fmt.Fprintf(os.Stderr, "Error executing CLI: %s\n", err.Error())
os.Exit(1)
}
os.Exit(exitStatus)
}