Convert Hook to an Option.

This commit is contained in:
Alec Thomas
2018-05-27 13:37:17 -04:00
committed by Gerald Kaszuba
parent cf89213e1e
commit afbb431641
4 changed files with 56 additions and 28 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ usage: {{.Name}}
var defaultHelpTemplate = template.Must(template.New("help").Parse(defaultHelp))
// Help returns a Hook that will display help and exit.
func Help(tmpl *template.Template, tmplctx map[string]interface{}) Hook {
func Help(tmpl *template.Template, tmplctx map[string]interface{}) HookFunction {
return func(app *Kong, ctx *Context, trace *Trace) error {
merged := map[string]interface{}{
"Application": app.Model,