refactor, more robust flag propagation

This commit is contained in:
Jared Forsyth
2013-11-20 01:05:18 -07:00
parent 73e88630a5
commit dc8a62e0e9
5 changed files with 76 additions and 31 deletions

View File

@@ -57,6 +57,14 @@ func (c Command) Run(ctx *Context) error {
return err
}
nerr := normalizeFlags(c.Flags, set)
if nerr != nil {
fmt.Println(nerr)
fmt.Println("")
ShowCommandHelp(ctx, c.Name)
fmt.Println("")
return nerr
}
context := NewContext(ctx.App, set, ctx.globalSet)
if checkCommandHelp(context, c.Name) {
return nil