urfave-cli/command.go

17 lines
304 B
Go
Raw Normal View History

package cli
type Command struct {
Name string
ShortName string
Usage string
Description string
Action Handler
Flags []Flag
}
2013-07-18 19:23:00 -07:00
func (command Command) Run(c *Context) {
set := flagSet(command.Flags)
set.Parse(c.Args()[1:])
command.Action(NewContext(set, c.globalSet))
}