Merge branch 'master' of https://github.com/pierrec/go-flags
diff --git a/option.go b/option.go
index 2f41d85..f39bfae 100644
--- a/option.go
+++ b/option.go
@@ -86,6 +86,10 @@
defaultLiteral string
}
+func (option *Option) Field() reflect.Value {
+ return option.value
+}
+
// LongNameWithNamespace returns the option's long name with the group namespaces
// prepended by walking up the option's group tree. Namespaces and the long name
// itself are separated by the parser's namespace delimiter. If the long name is
@@ -172,6 +176,11 @@
return option.isSet
}
+// IsSetDefault returns true if option has been set with its default value.
+func (option *Option) IsSetDefault() bool {
+ return option.isSetDefault
+}
+
// Set the value of an option to the specified value. An error will be returned
// if the specified value could not be converted to the corresponding option
// value type.
@@ -267,6 +276,7 @@
for _, d := range usedDefault {
option.set(&d)
+ option.isSetDefault = true
}
} else {
tp := option.value.Type()