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

Documentation of arguments #22

Open
cdeil opened this issue Jan 1, 2018 · 3 comments
Open

Documentation of arguments #22

cdeil opened this issue Jan 1, 2018 · 3 comments

Comments

@cdeil
Copy link

cdeil commented Jan 1, 2018

Currently you document command like this (see here):

.. program:: cli  (including help text)
.. code-block:: shell
.. rubric:: Options
.. rubric:: Arguments

Click in the console help output documents commands like this

Usage (corresponding to your shell code block)
Help text
Options

Click docs at http://click.pocoo.org/dev/arguments/ say

Click will also not attempt to document arguments for you and wants you to document them manually in order to avoid ugly help pages.

and expects arguments to be documented in the help text. Given that arguments don't support a help the argument docs you are generating doesn't really contain much useful information.

How about removing arguments docs completely, i.e. follow the lead of click for the help page?

Or if you want to keep it: how about putting the argument description before the options, i.e. closer to where arguments are usually described for click commands, and add a config option for click-sphinx users to select if they want to emit the arguments rubric (for me it would be no, I would like to not have it)?


A more minor question / change request I have is whether it would be better to put the command help text after the usage line. This is then how click and man pages in general do it, and what I find most readable to have the usage line at the top.


@stephenfin - Let me know what you think. If you agree with any of the suggestions I'd be happy to make a pull request.

@stephenfin
Copy link
Member

@cdeil The best way to approach this is with a PR. I'm pretty sure I borrowed the layout from click-contrib's brethren, sphinxcontrib-autoprogram. Ideally, I'd like to make this configurable. Perhaps a hide_args option, both globally and per-directive? Alternatively, a show_args option that defaults to True now but emits a warning if not manually configured. We can then modify this to default to False in a future release.

@girivs82
Copy link

girivs82 commented Jun 3, 2022

Just checking if there has been any progress on this issue. Is this happening?

@stephenfin
Copy link
Member

No. As noted above, we'd need a PR to work on this

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

3 participants