diff options
| author | Rick <[email protected]> | 2017-10-02 14:18:41 +0100 |
|---|---|---|
| committer | Rick <[email protected]> | 2017-10-02 14:18:41 +0100 |
| commit | d7961941f0ceee4e55062041991de7bbd43b2b57 (patch) | |
| tree | 8eb798350d16f89ebfceca8b22011427c69b2289 /parse.go | |
| parent | 398a01ebab8b6260be8714a39ad19ecb0db58dc1 (diff) | |
Altered help tag parsing to reduce the constraints on help text content; old behaviour is retained for backward compatibility
Diffstat (limited to 'parse.go')
| -rw-r--r-- | parse.go | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -153,6 +153,11 @@ func NewParser(config Config, dests ...interface{}) (*Parser, error) { dest: val, } + help, exists := field.Tag.Lookup("help") + if exists { + spec.help = help + } + // Check whether this field is supported. It's good to do this here rather than // wait until setScalar because it means that a program with invalid argument // fields will always fail regardless of whether the arguments it received @@ -193,7 +198,7 @@ func NewParser(config Config, dests ...interface{}) (*Parser, error) { spec.positional = true case key == "separate": spec.separate = true - case key == "help": + case key == "help": // deprecated spec.help = value case key == "env": // Use override name if provided |
