Commit 48ca3f28 authored by Rob Pike's avatar Rob Pike

flag: fix bug in handling of booleans on error

Fixes #3869.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6448072
parent 88e858ac
......@@ -707,7 +707,7 @@ func (f *FlagSet) parseOne() (bool, error) {
if fv, ok := flag.Value.(*boolValue); ok { // special case: doesn't need an arg
if has_value {
if err := fv.Set(value); err != nil {
f.failf("invalid boolean value %q for -%s: %v", value, name, err)
return false, f.failf("invalid boolean value %q for -%s: %v", value, name, err)
}
} else {
fv.Set("true")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment