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

Easily replace only the messages for --help and --version #889

Closed
porglezomp opened this issue Mar 7, 2017 · 5 comments
Closed

Easily replace only the messages for --help and --version #889

porglezomp opened this issue Mar 7, 2017 · 5 comments

Comments

@porglezomp
Copy link
Contributor

I'm trying to help make a project's help messages consistent, and all of the messages are of the format "Start …", "Check …", "Print …", so the "Prints version information" stands out. I was unable to find an easy way to replace only the help and version messages without re-wiring the commands themselves. Is there any easy solution I missed, or is this something that would have to be added.

@kbknapp
Copy link
Member

kbknapp commented Mar 9, 2017

There isn't a way to do this currently. You can override the --version by supplying a flag with the long of version. The only downside to doing this, is you'll need to check if it was used and print the version/exit accordingly. But that's only about 3 lines of code, so in practice it's not too bad.

@porglezomp
Copy link
Contributor Author

Would you appreciate a contribution that adds this? It's obviously easily worked around, but seems like it would be nice to have for other people as well.

@kbknapp
Copy link
Member

kbknapp commented Mar 9, 2017

I would be willing to consider it, sure! I don't have the bandwidth to work on it right now, but would gladly look at a PR adding it.

@porglezomp
Copy link
Contributor Author

So I'm working on this, and am wondering what you think the methods should be called. On args it's help, but with the help arg that gets awkward. Do you prefer help_message and version_message, help_help and version_help, or something else?

@porglezomp
Copy link
Contributor Author

Also, where in the yaml should these customizations end up? Based on the help_short and version_short it looks like they should top level?

homu added a commit that referenced this issue Mar 10, 2017
…napp

Allow customizing the --version and --help messages

Fixes #889

This currently doesn't support customizing them from YAML, so it still needs some work.
@homu homu closed this as completed in #894 Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants