Skip to content
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

Allow the user to specify strings for "USAGE:", "FLAGS:", "OPTIONS:", "ARGS:"... #686

Closed
crowdagger opened this issue Oct 11, 2016 · 4 comments
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations

Comments

@crowdagger
Copy link

Currently, the strings used in the help message "USAGE:", "FLAGS:", "OPTIONS:", "ARGS" are hardcoded in src/app/help.rs.

Similarly, in the create_help_and_version method of src/app/parser.rs, the help messages for -h and -v are hardcoded to "Prints help information" and "Prints version information", and I don't think (I may be wrong on this?) they can be overriden.

I think it would be nice to allow the user to set their own strings for those, e.g. to allow translation.

@kbknapp
Copy link
Member

kbknapp commented Oct 12, 2016

This can be done via App::templates.

Here's a video about templating as well.

There's also the AppSettings::UnifiedHelpMessage which simply combines FLAGS and OPTIONS into just OPTIONS.

I know that's not exactly what you're asking for, but at this time thats how it can be done. I'm not against giving a way to customize these strings, but am unsure about how to best do this.

As far as overriding the default help or version messages, I'm also open to giving ways to customize those...I just need to finish a few other issues first 😜

@kbknapp kbknapp added C-enhancement Category: Raise on the bar on expectations P4: nice to have A-help Area: documentation, including docs.rs, readme, examples, etc... labels Oct 12, 2016
@crowdagger
Copy link
Author

Yes, it's possible to use template and overriding default implementations for help/version, just thought it could be an enhancement :) (Didn't know about the videos, that's really nice)

@kbknapp
Copy link
Member

kbknapp commented Jan 3, 2017

@lise-henry is something like #805 what you're envisioning?

@kbknapp
Copy link
Member

kbknapp commented Jan 30, 2017

I'm going to close this issue in favor of #805

@kbknapp kbknapp closed this as completed Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-help Area: documentation, including docs.rs, readme, examples, etc... C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants