forked from chickenbug/stitch-cli-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
44 lines (36 loc) · 1.23 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
// Stitch is a tool for command-line administration of MongoDB Stitch applications.
package main
import (
"os"
"path/filepath"
"github.com/10gen/stitch-cli/commands"
"github.com/10gen/stitch-cli/utils"
"github.com/mitchellh/cli"
)
func main() {
c := cli.NewCLI(filepath.Base(os.Args[0]), utils.CLIVersion)
c.Args = os.Args[1:]
var ui cli.Ui = &cli.BasicUi{
Reader: os.Stdin,
Writer: os.Stdout,
ErrorWriter: os.Stderr,
}
c.Commands = map[string]cli.CommandFactory{
"whoami": commands.NewWhoamiCommandFactory(ui),
"login": commands.NewLoginCommandFactory(ui),
"logout": commands.NewLogoutCommandFactory(ui),
"export": commands.NewExportCommandFactory(ui),
"import": commands.NewImportCommandFactory(ui),
"diff": commands.NewDiffCommandFactory(ui),
"secrets": commands.NewSecretsCommandFactory(ui),
"secrets list": commands.NewSecretsListCommandFactory(ui),
"secrets add": commands.NewSecretsAddCommandFactory(ui),
"secrets update": commands.NewSecretsUpdateCommandFactory(ui),
"secrets remove": commands.NewSecretsRemoveCommandFactory(ui),
}
exitStatus, err := c.Run()
if err != nil {
ui.Error(err.Error())
}
os.Exit(exitStatus)
}