JMS #4: Delegating to Command.Run
This commit is contained in:
@@ -8,3 +8,9 @@ type Command struct {
|
||||
Action Handler
|
||||
Flags []Flag
|
||||
}
|
||||
|
||||
func (command Command) Run(c *Context) {
|
||||
set := flagSet(command.Flags)
|
||||
set.Parse(c.Args()[1:])
|
||||
command.Action(NewContext(set, c.globalSet))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user