-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
42 lines (33 loc) · 857 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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package main
import (
"fmt"
"os"
"github.com/mitchellh/cli"
"github.com/hashicorp/terraform-equivalence-testing/internal/cmd"
)
var (
version = "dev"
)
func main() {
ui := cli.BasicUi{
Reader: os.Stdin,
Writer: os.Stdout,
ErrorWriter: os.Stderr,
}
command := cli.NewCLI("terraform-equivalence-testing", version)
command.Args = os.Args[1:]
command.Commands = map[string]cli.CommandFactory{
"diff": cmd.DiffCommandFactory(&ui),
"update": cmd.UpdateCommandFactory(&ui),
}
command.HelpFunc = cli.BasicHelpFunc("terraform-equivalence-testing")
command.HelpWriter = os.Stdout
command.ErrorWriter = os.Stderr
status, err := command.Run()
if err != nil {
ui.Error(fmt.Sprintf("failed to execute equivalence tests: %v", err))
}
os.Exit(status)
}