Apply hooks to default values.

This commit is contained in:
Alec Thomas
2018-09-20 18:16:45 +10:00
parent 54338bd8b1
commit 6fa83bdc0e
7 changed files with 107 additions and 35 deletions
+13 -12
View File
@@ -196,18 +196,19 @@ func (n *Node) Path() (out string) {
// A Value is either a flag or a variable positional argument.
type Value struct {
Flag *Flag // Nil if positional argument.
Name string
Help string
Default string
Enum string
Mapper Mapper
Tag *Tag
Target reflect.Value
Required bool
Set bool // Set to true when this value is set through some mechanism.
Format string // Formatting directive, if applicable.
Position int // Position (for positional arguments).
Flag *Flag // Nil if positional argument.
Name string
Help string
Default string
DefaultValue reflect.Value
Enum string
Mapper Mapper
Tag *Tag
Target reflect.Value
Required bool
Set bool // Set to true when this value is set through some mechanism.
Format string // Formatting directive, if applicable.
Position int // Position (for positional arguments).
}
// EnumMap returns a map of the enums in this value.