Skip to content

Commit

Permalink
Fix error message for invalid use of default tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jessevdk committed Feb 27, 2016
1 parent 1f0c485 commit 6b9493b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion group.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func (g *Group) scanStruct(realval reflect.Value, sfield *reflect.StructField, h

if option.isBool() && option.Default != nil {
return newErrorf(ErrInvalidTag,
"boolean flag `%s' may not have default values, they always default to `false' and can only be turned off",
"boolean flag `%s' may not have default values, they always default to `false' and can only be turned on",
option.shortAndLongName())
}

Expand Down
4 changes: 2 additions & 2 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ func TestNoDefaultsForBools(t *testing.T) {
}

if runtime.GOOS == "windows" {
assertParseFail(t, ErrInvalidTag, "boolean flag `/d' may not have default values, they always default to `false' and can only be turned off", &opts)
assertParseFail(t, ErrInvalidTag, "boolean flag `/d' may not have default values, they always default to `false' and can only be turned on", &opts)
} else {
assertParseFail(t, ErrInvalidTag, "boolean flag `-d' may not have default values, they always default to `false' and can only be turned off", &opts)
assertParseFail(t, ErrInvalidTag, "boolean flag `-d' may not have default values, they always default to `false' and can only be turned on", &opts)
}
}

Expand Down

0 comments on commit 6b9493b

Please sign in to comment.