-
Notifications
You must be signed in to change notification settings - Fork 3
/
apps.go
67 lines (60 loc) · 1.53 KB
/
apps.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
55
56
57
58
59
60
61
62
63
64
65
66
67
package command
import (
"github.com/urfave/cli"
"github.com/wata727/herogate/herogate"
)
// AppsCommand is a command for listing your apps.
func AppsCommand() cli.Command {
return cli.Command{
Name: "apps",
Usage: "list your apps",
Action: herogate.Apps,
}
}
// AppsCreateCommand is a command for creating a new app.
func AppsCreateCommand() cli.Command {
return cli.Command{
Name: "apps:create",
ShortName: "create",
Usage: "creates a new app",
Action: herogate.AppsCreate,
}
}
// AppsInfoCommand is a command for showing the app's details.
func AppsInfoCommand() cli.Command {
return cli.Command{
Name: "apps:info",
ShortName: "info",
Usage: "show detailed app information",
Flags: sharedFlags(),
Action: herogate.AppsInfo,
}
}
// AppsOpenCommand is a command for opening the app in a web browser.
func AppsOpenCommand() cli.Command {
return cli.Command{
Name: "apps:open",
ShortName: "open",
Usage: "open the app in a web browser",
Flags: sharedFlags(),
Action: herogate.AppsOpen,
}
}
// AppsDestroyCommand is a command for detroying the app.
func AppsDestroyCommand() cli.Command {
return cli.Command{
Name: "apps:destroy",
ShortName: "destroy",
Usage: "permanently destroy an app",
Flags: append(sharedFlags(), appsDestroyFlags()...),
Action: herogate.AppsDestroy,
}
}
func appsDestroyFlags() []cli.Flag {
return []cli.Flag{
cli.StringFlag{
Name: "confirm",
Usage: "destroy an app without the app name re-typing",
},
}
}