diff options
| author | Emmanouil "Manolis" Maragkakis <[email protected]> | 2017-01-23 20:41:12 -0500 |
|---|---|---|
| committer | Emmanouil "Manolis" Maragkakis <[email protected]> | 2017-01-23 20:41:12 -0500 |
| commit | db274311536204025bd248faaa74347707be9d76 (patch) | |
| tree | 9fb9264188c1c93a7340885797956e86dad97075 /README.md | |
| parent | 7c77c70f8528a7b3310820aeec46d56a5be1ba70 (diff) | |
add support for description string
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -263,6 +263,33 @@ usage: example [--name NAME] error: error processing --name: missing period in "oops" ``` +### Description strings + +```go +type args struct { + Foo string +} + +func (args) Description() string { + return "this program does this and that" +} + +func main() { + var args args + arg.MustParse(&args) +} +``` + +```shell +$ ./example -h +this program does this and that +usage: example [--foo FOO] + +options: + --foo FOO + --help, -h display this help and exit +``` + ### Documentation https://godoc.org/github.com/alexflint/go-arg |
