summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorSebastiaan Pasterkamp <[email protected]>2022-09-17 12:39:31 +0200
committerSebastiaan Pasterkamp <[email protected]>2022-09-17 12:55:00 +0200
commitc8b9567d1ba7f0ab20f93b60e5a8344c2c23c110 (patch)
treeab25f483d8ecd88e24e2e2d9f0c8726243816f3f /README.md
parentebd7a68a06bef58b87c1fd21c2e7db383adbcbf3 (diff)
Feat: Add epilog after help text
Similar to the Description at the top of the help text an Epilog is added at the bottom. Resolves #189
Diffstat (limited to 'README.md')
-rw-r--r--README.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7f1fdca..f105b17 100644
--- a/README.md
+++ b/README.md
@@ -462,6 +462,9 @@ Options:
### Description strings
+A descriptive message can be added at the top of the help text by implementing
+a `Description` function that returns a string.
+
```go
type args struct {
Foo string
@@ -487,6 +490,35 @@ Options:
--help, -h display this help and exit
```
+Similarly an epilogue can be added at the end of the help text by implementing
+the `Epilogue` function.
+
+```go
+type args struct {
+ Foo string
+}
+
+func (args) Epilogue() string {
+ return "For more information visit github.com/alexflint/go-arg"
+}
+
+func main() {
+ var args args
+ arg.MustParse(&args)
+}
+```
+
+```shell
+$ ./example -h
+Usage: example [--foo FOO]
+
+Options:
+ --foo FOO
+ --help, -h display this help and exit
+
+For more information visit github.com/alexflint/go-arg
+```
+
### Subcommands
*Introduced in version 1.1.0*