Decoders are now field mappers.

Mappers are responsible for mapping from command-line input to Go. This
is typically just decoding, but also includes other information such as
if the field is a bool.
This commit is contained in:
Alec Thomas
2018-06-03 16:07:30 +10:00
committed by Gerald Kaszuba
parent c8b487e49c
commit 48af58cefa
9 changed files with 337 additions and 288 deletions
+2 -2
View File
@@ -82,11 +82,11 @@ func init() {
})
}
// Help returns a Hook that will display help and exit.
// Help returns a Before hook that will display help and exit.
//
// tmpl receives a context with several top-level values, in addition to those passed through tmplctx:
// .Context which is of type *Context and .Path which is of type *Path.
func Help(tmpl *raymond.Template, tmplctx map[string]interface{}) HookFunction {
func Help(tmpl *raymond.Template, tmplctx map[string]interface{}) Before {
return func(ctx *Context, path *Path) error {
merged := map[string]interface{}{
"App": ctx.App,