cmdargs icon indicating copy to clipboard operation
cmdargs copied to clipboard

How can I customize --numeric-version?

Open suhdonghwi opened this issue 4 years ago • 13 comments

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

Thank you.

suhdonghwi avatar Aug 31 '20 09:08 suhdonghwi

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?

ndmitchell avatar Aug 31 '20 09:08 ndmitchell

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

suhdonghwi avatar Sep 01 '20 23:09 suhdonghwi

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

ndmitchell avatar Sep 02 '20 10:09 ndmitchell

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

suhdonghwi avatar Sep 02 '20 10:09 suhdonghwi

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.

ndmitchell avatar Sep 02 '20 10:09 ndmitchell

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.

suhdonghwi avatar Sep 02 '20 10:09 suhdonghwi

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?

ndmitchell avatar Sep 02 '20 10:09 ndmitchell

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.

suhdonghwi avatar Sep 02 '20 10:09 suhdonghwi

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

ndmitchell avatar Sep 02 '20 11:09 ndmitchell

Yes, it would be sufficient.

suhdonghwi avatar Sep 02 '20 11:09 suhdonghwi

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.

ndmitchell avatar Sep 02 '20 12:09 ndmitchell

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!

suhdonghwi avatar Sep 06 '20 12:09 suhdonghwi

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.

ndmitchell avatar Sep 06 '20 17:09 ndmitchell