From db274311536204025bd248faaa74347707be9d76 Mon Sep 17 00:00:00 2001 From: "Emmanouil \"Manolis\" Maragkakis" Date: Mon, 23 Jan 2017 20:41:12 -0500 Subject: add support for description string --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index bc761de..8b6f3d8 100644 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.3