diff options
| author | Alex Flint <[email protected]> | 2017-10-02 17:07:17 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-10-02 17:07:17 -0700 |
| commit | 59fccacb2679dde66e0b20ed65bd26178fcbf54e (patch) | |
| tree | f0814a6cf76ebae438a0d827466c853c913b8b3f /doc.go | |
| parent | 398a01ebab8b6260be8714a39ad19ecb0db58dc1 (diff) | |
| parent | ba9514f0be00c17e53b4e0e255bcb9482354935f (diff) | |
Merge pull request #59 from rickb777/master
Altered help tag parsing to allow comma and colon
Diffstat (limited to 'doc.go')
| -rw-r--r-- | doc.go | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -19,18 +19,21 @@ // Fields can be bool, string, any float type, or any signed or unsigned integer type. // They can also be slices of any of the above, or slices of pointers to any of the above. // -// Tags can be specified using the `arg` package name: +// Tags can be specified using the `arg` and `help` tag names: // // var args struct { // Input string `arg:"positional"` // Log string `arg:"positional,required"` -// Debug bool `arg:"-d,help:turn on debug mode"` +// Debug bool `arg:"-d" help:"turn on debug mode"` // RealMode bool `arg:"--real" // Wr io.Writer `arg:"-"` // } // -// The valid tag strings are `positional`, `required`, and `help`. Further, any tag string -// that starts with a single hyphen is the short form for an argument (e.g. `./example -d`), -// and any tag string that starts with two hyphens is the long form for the argument -// (instead of the field name). Fields can be excluded from processing with `arg:"-"`. +// Any tag string that starts with a single hyphen is the short form for an argument +// (e.g. `./example -d`), and any tag string that starts with two hyphens is the long +// form for the argument (instead of the field name). +// +// Other valid tag strings are `positional` and `required`. +// +// Fields can be excluded from processing with `arg:"-"`. package arg |
