JMS #4: Delegating to Command.Run

This commit is contained in:
Jeremy Saenz
2013-07-18 19:23:00 -07:00
parent 87d3b81d55
commit 4495e2e996
2 changed files with 7 additions and 3 deletions
+6
View File
@@ -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))
}