-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
54 lines (45 loc) · 1 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
52
53
54
// mrmanager - request temporary credentals and put them in a useful place
// main.go: version and CLI bits
//
// Copyright 2019-2022 F5 Inc.
// Licensed under the BSD 3-clause license; see LICENSE for more information.
package main
import (
"fmt"
"os"
"github.com/mitchellh/cli"
)
func main() {
ui := &cli.BasicUi{
Reader: os.Stdin,
Writer: os.Stdout,
ErrorWriter: os.Stderr,
}
c := cli.NewCLI("mrmanager", "3.2.1")
c.Args = os.Args[1:]
c.Commands = map[string]cli.CommandFactory{
"aws": func() (cli.Command, error) {
return &AWSCommand{
UI: &cli.ColoredUi{
Ui: ui,
ErrorColor: cli.UiColorRed,
WarnColor: cli.UiColorYellow,
},
}, nil
},
"rds": func() (cli.Command, error) {
return &RDSCommand{
UI: &cli.ColoredUi{
Ui: ui,
ErrorColor: cli.UiColorRed,
WarnColor: cli.UiColorYellow,
},
}, nil
},
}
exitStatus, err := c.Run()
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
}
os.Exit(exitStatus)
}