change help hook and call Reset later

change to BeforeResolve hook to catch calls to '--help' earlier;
call reset later in Kong.Parse() to allow help hook to get hooked;
add test;
This commit is contained in:
pyq-lsa
2022-05-01 13:17:44 -07:00
committed by Alec Thomas
parent 7c6ff10d33
commit 5538b7f045
4 changed files with 24 additions and 5 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ const (
// Help flag.
type helpValue bool
func (h helpValue) BeforeApply(ctx *Context) error {
func (h helpValue) BeforeResolve(ctx *Context) error {
options := ctx.Kong.helpOptions
options.Summary = false
err := ctx.Kong.help(options, ctx)