/
apps.go
48 lines (44 loc) · 1.18 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
package cmd
import (
"github.com/Scalingo/cli/appdetect"
"github.com/Scalingo/cli/apps"
"github.com/Scalingo/cli/cmd/autocomplete"
"github.com/urfave/cli"
)
var (
appsCommand = cli.Command{
Name: "apps",
Category: "Global",
Description: "List your apps and give some details about them",
Usage: "List your apps",
Before: AuthenticateHook,
Action: func(c *cli.Context) {
if err := apps.List(); err != nil {
errorQuit(err)
}
},
BashComplete: func(c *cli.Context) {
autocomplete.CmdFlagsAutoComplete(c, "apps")
},
}
appsInfoCommand = cli.Command{
Name: "apps-info",
Category: "App Management",
Flags: []cli.Flag{appFlag},
Usage: "Display the application information",
Description: `Display various application information such as the force HTTPS status, the stack configured, sticky sessions, etc.
Example:
scalingo apps-info --app my-app
`,
Before: AuthenticateHook,
Action: func(c *cli.Context) {
currentApp := appdetect.CurrentApp(c)
if err := apps.Info(currentApp); err != nil {
errorQuit(err)
}
},
BashComplete: func(c *cli.Context) {
autocomplete.CmdFlagsAutoComplete(c, "apps-info")
},
}
)