Update builtin command to use CommandParams
This commit is contained in:
parent
fc8b01f0ac
commit
920fd39ec1
@ -63,11 +63,11 @@ 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{}) int32 {
|
||||
return (&DoThing{Command: c}).Execute(trm, flags)
|
||||
func (c *Command) ExecuteDoThing(trm terminal.UI, params *component.CommandParams) int32 {
|
||||
return (&DoThing{Command: c}).Execute(trm, params)
|
||||
}
|
||||
|
||||
func (c *Command) ExecuteInteractive(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
func (c *Command) ExecuteInteractive(trm terminal.UI, params *component.CommandParams) int32 {
|
||||
return (&Interactive{Command: c}).Execute(trm)
|
||||
}
|
||||
|
||||
@ -110,8 +110,8 @@ func (c *Command) Flags() component.CommandFlags {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Command) Execute(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
trm.Output("You gave me the flag: " + flags["hehe"].(string))
|
||||
func (c *Command) Execute(trm terminal.UI, params *component.CommandParams) int32 {
|
||||
trm.Output("You gave me the flag: " + params.Flags["hehe"].(string))
|
||||
|
||||
trm.Output(c.Help())
|
||||
trm.Output("My subcommands are: ")
|
||||
|
||||
@ -78,9 +78,9 @@ func (c *DoThing) Flags() component.CommandFlags {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *DoThing) Execute(trm terminal.UI, flags map[string]interface{}) int32 {
|
||||
func (c *DoThing) Execute(trm terminal.UI, params *component.CommandParams) int32 {
|
||||
trm.Output("Tricked ya! I actually do nothing :P")
|
||||
trm.Output("You gave me the stringflag: " + flags["stringflag"].(string))
|
||||
trm.Output("You gave me the stringflag: " + params.Flags["stringflag"].(string))
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user