aboutsummaryrefslogtreecommitdiff
path: root/flag.go
diff options
context:
space:
mode:
authorspf13 <[email protected]>2014-06-27 10:11:03 -0400
committerspf13 <[email protected]>2014-06-27 10:11:03 -0400
commitb02196a78893a71903e9ad98359e7f891b1e7781 (patch)
tree200eb2e47953d6076e1827cd05cdd82bfa15859a /flag.go
parent2790b68253e8df395da60096bcea40e90daa3b41 (diff)
Moving Value interface to the appropriate file
Diffstat (limited to 'flag.go')
-rw-r--r--flag.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/flag.go b/flag.go
index 9a16e7a..dfc03d2 100644
--- a/flag.go
+++ b/flag.go
@@ -149,6 +149,13 @@ type Flag struct {
Changed bool // If the user set the value (or if left to default)
}
+// Value is the interface to the dynamic value stored in a flag.
+// (The default value is represented as a string.)
+type Value interface {
+ String() string
+ Set(string) error
+}
+
// sortFlags returns the flags as a slice in lexicographical sorted order.
func sortFlags(flags map[string]*Flag) []*Flag {
list := make(sort.StringSlice, len(flags))