-
-
Notifications
You must be signed in to change notification settings - Fork 156
Closed
Description
I'm basically trying to document a complex arg with Help() to no avail.
package main
import "github.com/alecthomas/kong"
var CLI struct {
CmdTest commandWithHelp `cmd:""`
}
type commandWithHelp struct {
Test argumentWithHelp `arg:"" help:"Test"`
}
type argumentWithHelp struct {
Test string `arg:""`
}
func (u *argumentWithHelp) Help() string {
return `Some longer text`
}
func (u *commandWithHelp) Run(ctx *kong.Context) error {
return nil
}
func main() {
ctx := kong.Parse(&CLI, kong.ConfigureHelp(kong.HelpOptions{
Compact: true,
Summary: false,
}))
_ = ctx.Run()
}
❯ go run . cmd-test -h
Usage: kongtest cmd-test <command>
Flags:
-h, --help Show context-sensitive help.
Commands:
cmd-test <test> Test
- For some reason, kong thinks that
cmd-testhas acmd-testsubcommand - Long description for
testisn't called or displayed
Metadata
Metadata
Assignees
Labels
No labels