forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.go
42 lines (34 loc) · 762 Bytes
/
input.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
/**
* 1. Setup the server so cf can call it under main.
e.g. `cf my-plugin` creates the callable server. now we can call the Run command
* 2. Implement Run that is the actual code of the plugin!
* 3. Return an error
**/
package main
import (
"fmt"
"code.cloudfoundry.org/cli/plugin"
)
type Input struct {
}
func (c *Input) Run(cliConnection plugin.CliConnection, args []string) {
if args[0] == "input" {
var Echo string
fmt.Scanf("%s", &Echo)
fmt.Println("THE WORD IS: ", Echo)
}
}
func (c *Input) GetMetadata() plugin.PluginMetadata {
return plugin.PluginMetadata{
Name: "Input",
Commands: []plugin.Command{
{
Name: "input",
HelpText: "help text for input",
},
},
}
}
func main() {
plugin.Start(new(Input))
}