sphinx-contrib / autoprogram

Documenting CLI programs
https://pypi.org/project/sphinxcontrib-autoprogram/
Other
44 stars 23 forks source link

Subparsers help is not shown #46

Open JOJ0 opened 3 years ago

JOJ0 commented 3 years ago

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

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

@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?