Skip to content

Commit

Permalink
Generate flag error output for errors returned from the parseFunc (sp…
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbanzai authored and n10v committed Sep 30, 2017
1 parent 7aff26d commit 5c2d607
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,9 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
}

err = fn(flag, value)
if err != nil {
f.failf(err.Error())
}
return
}

Expand Down Expand Up @@ -966,6 +969,9 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse
}

err = fn(flag, value)
if err != nil {
f.failf(err.Error())
}
return
}

Expand Down

0 comments on commit 5c2d607

Please sign in to comment.