-
Notifications
You must be signed in to change notification settings - Fork 52
/
stage.go
56 lines (50 loc) · 1.11 KB
/
stage.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
package main
import (
"github.com/IBM-Cloud/ibm-cloud-cli-sdk/plugin"
"fmt"
)
type StageDemo struct{}
func main() {
plugin.Start(new(StageDemo))
}
func (n *StageDemo) Run(context plugin.PluginContext, args []string) {
switch args[0] {
case "list":
fmt.Println("Running command 'list'.")
case "show":
fmt.Println("Running command 'show'.")
}
}
func (n *StageDemo) GetMetadata() plugin.PluginMetadata {
return plugin.PluginMetadata{
Name: "stage-demo",
Version: plugin.VersionType{
Major: 0,
Minor: 0,
Build: 1,
},
Namespaces: []plugin.Namespace{
plugin.Namespace{
Name: "stage",
Description: "Show example of stage annotation",
Stage: plugin.StageBeta,
},
},
Commands: []plugin.Command{
{
Namespace: "stage",
Name: "list",
Description: "List resources",
Usage: "ibmcloud stage list",
Stage: plugin.StageDeprecated,
},
{
Namespace: "stage",
Name: "show",
Description: "Show the details of a resource",
Usage: "ibmcloud stage show",
Stage: plugin.StageExperimental,
},
},
}
}