From 39fd1507da34e0c346ff52241a01e89a224f8cc6 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Wed, 20 Jun 2018 23:47:26 +1000 Subject: [PATCH] Document HelpOptions. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b5233e..6aeb048 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,10 @@ All builtin Go types (as well as a bunch of useful stdlib types like `time.Time` ### `Help(HelpFunc)` - customising help -Custom help can be wired into Kong via the `Help(HelpFunc)` option. The `HelpFunc` is passed a `Context`, which contains the parsed context for the current command-line. See the implementation of `PrintHelp` for an example. +The default help output is usually sufficient, but if it's not, there are two solutions. + +1. Use `HelpOptions(options...HelpOption)` to configure the default help (see [HelpOption](https://godoc.org/github.com/alecthomas/kong#HelpOption) for details). +2. Custom help can be wired into Kong via the `Help(HelpFunc)` option. The `HelpFunc` is passed a `Context`, which contains the parsed context for the current command-line. See the implementation of `PrintHelp` for an example. ### `Hook(&field, HookFunc)` - callback hooks to execute when the command-line is parsed