-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.go
51 lines (44 loc) · 1.01 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
46
47
48
49
50
51
package main
import (
"io"
"log"
"os"
"github.com/azure/armstrong/commands"
"github.com/mitchellh/cli"
"github.com/sirupsen/logrus"
)
func main() {
logrus.SetLevel(logrus.InfoLevel)
log.SetOutput(io.Discard)
c := &cli.CLI{
Name: "armstrong",
Version: VersionString(),
Args: os.Args[1:],
HelpWriter: os.Stdout,
}
c.Commands = map[string]cli.CommandFactory{
"generate": func() (cli.Command, error) {
return &commands.GenerateCommand{}, nil
},
"validate": func() (cli.Command, error) {
return &commands.ValidateCommand{}, nil
},
"test": func() (cli.Command, error) {
return &commands.TestCommand{}, nil
},
"cleanup": func() (cli.Command, error) {
return &commands.CleanupCommand{}, nil
},
"report": func() (cli.Command, error) {
return &commands.ReportCommand{}, nil
},
"credscan": func() (cli.Command, error) {
return &commands.CredentialScanCommand{}, nil
},
}
exitStatus, err := c.Run()
if err != nil {
logrus.Fatal(err)
}
os.Exit(exitStatus)
}