aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
authorBrendan Burns <[email protected]>2015-03-11 11:10:28 -0700
committerspf13 <[email protected]>2015-03-12 22:17:30 -0400
commit11b7cf8387a31f278486eaad758162830eca8c73 (patch)
tree1e6ed20e3a409603d621ce994e615f90cb3d58bc /flag.go
parent370c3171201099fa6b466db45c8a032cbce33d8d (diff)
Always return when err is not nil.
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/flag.go b/flag.go
index ad65dda..72165f6 100644
--- a/flag.go
+++ b/flag.go
@@ -498,6 +498,7 @@ func (f *FlagSet) parseShortArg(s string, args []string) (a []string, err error)
if len(args) == 0 {
return
}
+ return
}
if alreadythere {
if bv, ok := flag.Value.(boolFlag); ok && bv.IsBoolFlag() {
@@ -551,6 +552,9 @@ func (f *FlagSet) parseArgs(args []string) (err error) {
} else {
args, err = f.parseShortArg(s, args)
}
+ if err != nil {
+ return
+ }
}
return
}