ndmitchell / cmdargs

Haskell library for command line argument processing
Other
91 stars 12 forks source link

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

Open suhdonghwi opened 4 years ago

suhdonghwi commented 4 years ago

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

Thank you.

ndmitchell commented 4 years ago

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 commented 4 years ago

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

ndmitchell commented 4 years ago

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

suhdonghwi commented 4 years ago

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

ndmitchell commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

suhdonghwi commented 4 years ago

Yes, it would be sufficient.

ndmitchell commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.