neithere / argh

An argparse wrapper that doesn't make you say "argh" each time you deal with it.
http://argh.rtfd.org
GNU Lesser General Public License v3.0
369 stars 55 forks source link

Add ability to display long options in usage message #231

Open mjreed-wbd opened 1 month ago

mjreed-wbd commented 1 month ago

Is your feature request related to a problem?

I have a command with boolean flags which all have descriptive names, but the default usage message shortens all of them to just their first letters.

Describe the solution you'd like

I would like a way to specify, perhaps with the @arg decorator, that a boolean flag should be listed in the usage message in long form rather than short. It's nice that I can see the long form and my custom description via "--help", but I'd prefer to see the long form also in the short message you get when not providing the required parameters.

Describe alternatives you've considered

The only alternative I've found is throwing away the automatic usage message and writing a custom one. Even if I want to do that, it's not clear how to specify that while using argh, since it's a parameter to argparse's parser constructor rather than add_argument.