-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
36 lines (31 loc) · 802 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
package main
import (
"fmt"
"os"
"github.com/zshamrock/vmx/config"
"gopkg.in/urfave/cli.v1"
)
func main() {
app := cli.NewApp()
app.Name = Name
app.Version = Version
app.Authors = []cli.Author{{Name: "Aliaksandr Kazlou", Email: "[email protected]"}}
app.Metadata = map[string]interface{}{"GitHub": "https://github.com/zshamrock/vmx"}
app.Usage = usage()
app.EnableBashCompletion = true
app.Flags = GlobalFlags
app.Commands = Commands
app.CommandNotFound = CommandNotFound
app.Before = func(c *cli.Context) error {
profile := getProfile(c)
config.Init(profile)
return nil
}
app.Run(os.Args)
}
func usage() string {
return fmt.Sprintf(`
vmx is a tool for interacting with cloud instances (like AWS EC2, for example) over SSH
[https://github.com/zshamrock/vmx]
`)
}