summaryrefslogtreecommitdiff
path: root/parse.go
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2015-11-22 10:04:14 +1030
committerAlex Flint <[email protected]>2015-11-22 10:04:14 +1030
commit5db9c77fa32bd444360f8376ddfa7bc209813b20 (patch)
treeed9a5f3a36a5822d82d47f4e8be7b40671e79183 /parse.go
parent785fa3f8c93bc43540b189bacaed9d9aba890528 (diff)
parent330a0da571888c4ec6dac345140a7ee663d00d6e (diff)
Merge pull request #13 from walle/show_builtin
Add built ins to options in help output
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 a9e509f..b6eae4e 100644
--- a/parse.go
+++ b/parse.go
@@ -19,6 +19,7 @@ type spec struct {
positional bool
help string
wasPresent bool
+ isBool bool
}
// ErrHelp indicates that -h or --help were provided
@@ -100,6 +101,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, ",") {