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

How can I customize --numeric-version? #66

Open
suhdonghwi opened this issue Aug 31, 2020 · 13 comments
Open

How can I customize --numeric-version? #66

suhdonghwi opened this issue Aug 31, 2020 · 13 comments

Comments

@suhdonghwi
Copy link

--numeric-version flag is automatically added as I use summary. Is there any way to customize help message of --numeric-version?

Thank you.

@ndmitchell
Copy link
Owner

You can't customise it arbitrarily, but it is taken from the numeric version in summary, as per https://hackage.haskell.org/package/cmdargs-0.10.20/docs/System-Console-CmdArgs-Implicit.html#v:summary. What were you hoping to customise it to say?

@suhdonghwi
Copy link
Author

I'd like to change the help message of --numeric-version, the default is "Print just the version number".

@ndmitchell
Copy link
Owner

What would you like to change it to? Curious if it needs to be configurable, or just have a better default.

@suhdonghwi
Copy link
Author

suhdonghwi commented Sep 2, 2020

Ah, it is because I'm making a non-English application. I need to internationalize command line help messages.

@ndmitchell
Copy link
Owner

Makes sense. Are there any other flags you've had difficulty translating? I'm surprised if this is the only one, so if there are multiple, I'd like to consider a good way to tackle them all. If it is the only one, we can do something more specific.

@suhdonghwi
Copy link
Author

Yes, among the options that were in my application, --numeric-version was the only thing that has non customizable help message. Everything else was customizable.

@ndmitchell
Copy link
Owner

OK, then I'm inclined to target that specifically. How did you customise things like --help and --verbose? Or did you solve those by disabling them?

@suhdonghwi
Copy link
Author

I could customize --help by doing the following to a specific mode:

&= helpArg [help "(internationalized message)"]

But I did not try --verbose flag, I don't use it.

@ndmitchell
Copy link
Owner

Seems like adding numericVersionArg would be the right thing to do, do you agree?

@suhdonghwi
Copy link
Author

Yes, it would be sufficient.

@ndmitchell
Copy link
Owner

Could I tempt you to submit a patch? I think it shouldn't be too hard, but happy to help if its confusing. Otherwise, might take me a little while to get to it.

@suhdonghwi
Copy link
Author

Sorry for being late. It would be great if I could contribute this project. I might try this later when I have enough time to deal with this issue. Thank you!

@ndmitchell
Copy link
Owner

You are the only person using cmdargs in this situation as far as I can tell, so no rush on my side at all. Shout if you need help or advice.

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