Invoking help with a flag other than -h #289
-
My app has a backward compatibility reason to reserve |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
it figures I find it right after posting. Is this the most effective approach? Help bool `short:"?" help:"show syntax summary"`
k, err := kong.New(&args, kong.NoDefaultHelp())
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
ctx, err := k.Parse(os.Args[1:])
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
if args.Help {
_ = kong.DefaultHelpPrinter(kong.HelpOptions{}, ctx)
os.Exit(0)
} |
Beta Was this translation helpful? Give feedback.
-
From memory there's a way to do this already - use |
Beta Was this translation helpful? Give feedback.
From memory there's a way to do this already - use
kong.New()
, then modify the existing help flag in the model to remove the short flag.