summaryrefslogtreecommitdiff
path: root/parse.go
diff options
context:
space:
mode:
Diffstat (limited to 'parse.go')
-rw-r--r--parse.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/parse.go b/parse.go
index 923e749..8bb2c2d 100644
--- a/parse.go
+++ b/parse.go
@@ -54,6 +54,7 @@ type spec struct {
positional bool
help string
wasPresent bool
+ isBool bool
}
// ErrHelp indicates that -h or --help were provided
@@ -135,6 +136,11 @@ func NewParser(dests ...interface{}) (*Parser, error) {
return nil, fmt.Errorf("%s.%s: %s fields are not supported", t.Name(), field.Name, scalarType.Kind())
}
+ // Specify that it is a bool for usage
+ if scalarType.Kind() == reflect.Bool {
+ spec.isBool = true
+ }
+
// Look at the tag
if tag != "" {
for _, key := range strings.Split(tag, ",") {