-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
53 lines (46 loc) · 945 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
43
44
45
46
47
48
49
50
51
52
53
package main
//go:generate ./version.sh
import (
"fmt"
"os"
"github.com/degica/barcelona-cli/cmd"
"github.com/degica/barcelona-cli/config"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = "bcn"
app.Version = Version
app.Usage = "Barcelona Command Line Client"
app.Flags = []cli.Flag{
cli.BoolFlag{
Name: "debug, d",
Usage: "Enable debug mode",
Destination: &config.Debug,
},
}
app.Commands = []cli.Command{
cmd.LoginCommand,
cmd.DeployCommand,
cmd.CreateCommand,
cmd.DistrictCommand,
cmd.EndpointCommand,
cmd.APICommand,
cmd.EnvCommand,
cmd.RunCommand,
cmd.SSHCommand,
cmd.ReleaseCommand,
cmd.NotificationCommand,
cmd.AppCommand,
cmd.ReviewCommand,
cmd.ProfileCommand,
cmd.SecretCommand,
}
pwd, err := os.Getwd()
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
cmd.HeritageConfigFilePath = pwd + "/barcelona.yml"
app.Run(os.Args)
}