diff options
| author | Brendan Burns <[email protected]> | 2015-03-11 11:10:28 -0700 |
|---|---|---|
| committer | spf13 <[email protected]> | 2015-03-12 22:17:30 -0400 |
| commit | 11b7cf8387a31f278486eaad758162830eca8c73 (patch) | |
| tree | 1e6ed20e3a409603d621ce994e615f90cb3d58bc | |
| parent | 370c3171201099fa6b466db45c8a032cbce33d8d (diff) | |
Always return when err is not nil.
| -rw-r--r-- | bool_test.go | 2 | ||||
| -rw-r--r-- | example_test.go | 2 | ||||
| -rw-r--r-- | flag.go | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/bool_test.go b/bool_test.go index 72a12be..fe45b8d 100644 --- a/bool_test.go +++ b/bool_test.go @@ -9,7 +9,7 @@ import ( "strconv" "testing" - . "github.com/ogier/pflag" + . "github.com/spf13/pflag" ) // This value can be a boolean ("true", "false") or "maybe" diff --git a/example_test.go b/example_test.go index 6aaed3c..9be7a49 100644 --- a/example_test.go +++ b/example_test.go @@ -11,7 +11,7 @@ import ( "strings" "time" - flag "github.com/ogier/pflag" + flag "github.com/spf13/pflag" ) // Example 1: A single string flag called "species" with default value "gopher". @@ -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 } |
