-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to override HelpFlags? #119
Comments
I've tried this, and it also doesn't work: var (
app = func() *kingpin.Application {
a := kingpin.New(os.Args[0], "A command-line chat application.")
a.HelpFlag = a.Flag("foo", "Show help.")
a.HelpFlag.Bool()
return a
}()
// This also shows both help flags:
//
// Flags:
// --help Show context-sensitive help (also try --help-long and --help-man).
// --foo Show help.
) |
What do you mean exactly by "override"? HelpFlag is designed to be mutated in place and not overridden. To replace the entire help you need to specify an alternative usage template via app.UsageTemplate(). There are several alternatives included that may be used as starting points. |
Sure. I'm probably missing something. Tell me then, how would I go about replacing this message:
With this:
|
You can not alter the help string for an existing flag. I've added this to the feature list for v3. |
First up, thanks for the amazing package. Very cool, I plan to make use of it in my app. I really like the ability to handle sub-commands as well as flags.
I'm struggling to see how to override the default
HelpFlag
and message. I have the following app, based on one of your examples:Can you point me in the right direction?
The text was updated successfully, but these errors were encountered: