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

Subparsers help is not shown #46

Open
JOJ0 opened this issue Feb 22, 2021 · 2 comments
Open

Subparsers help is not shown #46

JOJ0 opened this issue Feb 22, 2021 · 2 comments

Comments

@JOJ0
Copy link

JOJ0 commented Feb 22, 2021

Usually I describe in short what a subcommand does by putting a text into a subparsers help argument. Argparser renders it like this:

$ disco -h
usage: disco [-h] [-v] [-o] {search,mix,suggest,import,setup} ...

positional arguments:
  {search,mix,suggest,import,setup}
    search              searches for releases and tracks in the Discogs
                        collection. Several actions can be executed on the
                        found items, eg. adding to a mix, updating track info
                        from Discogs or fetching additional information from
                        MusicBrainz/AcousticBrainz. View this subcommand's
                        help: disco search -h.
    mix                 manages your mixes. View this subcommand's help:
                        "disco mix -h."       
...          

This help is not shown anywhere in autoprogram generated manpages or html pages. How could I enable it so it is included in the main command section similar to how argparser shows it in main command --help?

@ewu63
Copy link

ewu63 commented Mar 29, 2021

It seems that the description string is shown, but not the help string for some reason. Perhaps a good enhancement would be to show help if description is not defined?

@JOJ0
Copy link
Author

JOJ0 commented Apr 30, 2021

@nwu63 thanks a lot for the hint. A workaround I am currently using is to just write what I want in a subparsers help into a variable and then use it for both help and description. The result is that it's included in

command -h (as described in above post, nothing changes)

but also in

command subcommand -h (right below "usage" and before detailed "options help")

This is ok for me for now, subcommand -h output is just a little longer, which is fine for my needs.

So since it's hard to get any issues fixed in this repo I'd consider this issue minor and energy should be spent on other issues. Should I better close it or leave it open so others find the workaround suggestions more easily?

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