-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
48 lines (39 loc) · 814 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
package main
import (
"fmt"
"code.cloudfoundry.org/cli/plugin"
)
type AppCloudPlugin struct{}
func (p *AppCloudPlugin) GetMetadata() plugin.PluginMetadata {
return plugin.PluginMetadata{
Name: "Swisscom Application Cloud",
Version: plugin.VersionType{
Major: 0,
Minor: 0,
Build: 1,
},
Commands: []plugin.Command{
{
Name: "view-tree",
HelpText: "View organization tree",
UsageDetails: plugin.Usage{
Usage: "view-tree",
},
},
},
}
}
// Run initiates the plugin
func (p *AppCloudPlugin) Run(cliConnection plugin.CliConnection, args []string) {
var err error
switch args[0] {
case "view-tree":
err = p.ViewTree(cliConnection)
if err != nil {
fmt.Printf("\n%s\n", redBold(err.Error()))
}
}
}
func main() {
plugin.Start(new(AppCloudPlugin))
}