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

Arguments don't show help text #132

Closed
aeisenbarth opened this issue Mar 22, 2024 · 0 comments
Closed

Arguments don't show help text #132

aeisenbarth opened this issue Mar 22, 2024 · 0 comments

Comments

@aeisenbarth
Copy link
Contributor

aeisenbarth commented Mar 22, 2024

(This is not really a bug)

Generated documentation shows a section for options with help text for each, and a section for arguments with only "Required argument".

I am using typer (probably not officially supported by sphinx-click) and I converted typer commands to click commands so that I can generate Sphinx documentation:

click_command = typer.main.get_command(typer_app)

Typer supports the help attribute for both options and arguments. To me, sphinx-click's arguments section implied that there should be descriptive text and that it was missing for some reason. It took me a while to find out that click.Argument does not have the help attribute by design (pallets/click#587, pallets/click#1049, pallets/click#1051, pallets/click#1217), and that click developers are so pertinaciously opinionated that they won't ever offer that flexibility (which is ok for an opinionated tool, but unfortunate for anything building on top of it).

That leaves the arguments without description.

My aim:

  • Make this information findable if another user searches for it (done)
  • Maybe you could add a block to sphinx-click documentation mentioning that arguments should be described in the command's description, as recommended by click developers.
    (Alternatively, one could consider following that philosophy and removing the arguments section altogether.)
  • (Another possibility would be to add partial support for typer's typer.main.TyperArgument which is a subclass of click.Argument, for example with getattr(arg, "help", ""))
@aeisenbarth aeisenbarth mentioned this issue Apr 3, 2024
4 tasks
stephenfin pushed a commit to aeisenbarth/sphinx-click that referenced this issue Apr 5, 2024
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

1 participant