Update command to return int32s
This commit is contained in:
parent
29c3cf439b
commit
260861dbb7
@ -58,15 +58,15 @@ func (c *Command) ExecuteFunc(cliArgs []string) interface{} {
|
||||
return c.Execute
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteInfo(trm terminal.UI, env plugincore.Project) int64 {
|
||||
func (c *Command) ExecuteInfo(trm terminal.UI, env plugincore.Project) int32 {
|
||||
return (&Info{Command: c}).Execute(trm, env)
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteDoThing(trm terminal.UI, flags map[string]interface{}) int64 {
|
||||
func (c *Command) ExecuteDoThing(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
return (&DoThing{Command: c}).Execute(trm, flags)
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteInteractive(trm terminal.UI, flags map[string]interface{}) int64 {
|
||||
func (c *Command) ExecuteInteractive(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
return (&Interactive{Command: c}).Execute(trm)
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ func (c *Command) Flags() []*option.Option {
|
||||
return []*option.Option{stringflag}
|
||||
}
|
||||
|
||||
func (c *Command) Execute(trm terminal.UI, flags map[string]interface{}) int64 {
|
||||
func (c *Command) Execute(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
trm.Output("You gave me the flag: " + flags["hehe"].(string))
|
||||
|
||||
trm.Output(c.Help())
|
||||
|
||||
@ -74,7 +74,7 @@ func (c *DoThing) Flags() []*option.Option {
|
||||
return []*option.Option{booltest, stringflag}
|
||||
}
|
||||
|
||||
func (c *DoThing) Execute(trm terminal.UI, flags map[string]interface{}) int64 {
|
||||
func (c *DoThing) Execute(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
trm.Output("Tricked ya! I actually do nothing :P")
|
||||
trm.Output("You gave me the stringflag: " + flags["stringflag"].(string))
|
||||
return 0
|
||||
|
||||
@ -67,7 +67,7 @@ func (c *Info) Flags() []*option.Option {
|
||||
return []*option.Option{}
|
||||
}
|
||||
|
||||
func (c *Info) Execute(trm terminal.UI, p plugincore.Project) int64 {
|
||||
func (c *Info) Execute(trm terminal.UI, p plugincore.Project) int32 {
|
||||
mn, _ := p.MachineNames()
|
||||
trm.Output("\nMachines in this project")
|
||||
trm.Output(strings.Join(mn[:], "\n"))
|
||||
|
||||
@ -64,7 +64,7 @@ func (c *Interactive) Flags() []*option.Option {
|
||||
return []*option.Option{}
|
||||
}
|
||||
|
||||
func (c *Interactive) Execute(trm terminal.UI) int64 {
|
||||
func (c *Interactive) Execute(trm terminal.UI) int32 {
|
||||
output, err := trm.Input(&terminal.Input{Prompt: "\nWhat do you have to say: "})
|
||||
if err != nil {
|
||||
trm.Output("Error getting input")
|
||||
|
||||
@ -91,20 +91,20 @@ func (c *Command) CommandInfo() *component.CommandInfo {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteMain(trm terminal.UI, flags map[string]interface{}) int64 {
|
||||
func (c *Command) ExecuteMain(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
trm.Output("You gave me the flag: " + flags["thing"].(string))
|
||||
|
||||
trm.Output("My subcommands are: `info` and `dothing`")
|
||||
return 0
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteThing(trm terminal.UI, flags map[string]interface{}) int64 {
|
||||
func (c *Command) ExecuteThing(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
trm.Output("Tricked ya! I actually do nothing :P")
|
||||
trm.Output("You gave me the stringflag: " + flags["stringflag"].(string))
|
||||
return 0
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteInfo(trm terminal.UI, p plugincore.Project, t plugincore.Target) int64 {
|
||||
func (c *Command) ExecuteInfo(trm terminal.UI, p plugincore.Project, t plugincore.Target) int32 {
|
||||
mn, _ := p.MachineNames()
|
||||
trm.Output("\nMachines in this project")
|
||||
trm.Output(strings.Join(mn[:], "\n"))
|
||||
@ -148,15 +148,15 @@ func (c *Command) ExecuteInfo(trm terminal.UI, p plugincore.Project, t plugincor
|
||||
trm.Output("machine id is: " + id)
|
||||
}
|
||||
|
||||
return 0
|
||||
return 10
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteOfni(trm terminal.UI) int64 {
|
||||
func (c *Command) ExecuteOfni(trm terminal.UI) int32 {
|
||||
trm.Output("I am bizzaro info! Call me ofni")
|
||||
return 0
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteUseHostPlugin(trm terminal.UI, basis plugincore.Basis) int64 {
|
||||
func (c *Command) ExecuteUseHostPlugin(trm terminal.UI, basis plugincore.Basis) int32 {
|
||||
trm.Output("I'm going to use a the host plugin to do something!\n\n")
|
||||
host, err := basis.Host()
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user