Skip to content

Set Command __doc__ string from the callback so Sphinx docs look nicer - #234

Merged
mitsuhiko merged 1 commit into
pallets:3.x-maintenancefrom
rayl:3.x-maintenance
Mar 31, 2015
Merged

mitsuhiko merged 1 commit into
pallets:3.x-maintenancefrom
rayl:3.x-maintenance

Conversation

@rayl

@rayl rayl commented Oct 7, 2014

Copy link
Copy Markdown
Contributor

Signed-off-by: Ray Lehtiniemi [email protected]

@kamilchm

kamilchm commented Oct 7, 2014

Copy link
Copy Markdown

👍

@Almad

Almad commented Dec 10, 2014

Copy link
Copy Markdown

👍 , although I think it's still going to miss the arguments. But far better then the current state.

@untitaker

Copy link
Copy Markdown
Contributor

The effort should rather go into a sphinx extension that is able to deal with commands properly (providing autocommand directives or something like that). Documenting CLI commands as classes or functions might be a good quick hack, but as @Almad said, you're missing the arguments with that.

Also, I don't think it's a semantically correct thing to set the docstring on this function, because click.command is not a "pure" decorator: The resulting object has no API compatibility with the wrapped function.

I'll leave this open because it might be useful for others though.

@mitsuhiko

Copy link
Copy Markdown
Contributor

I'm somewhat okay with that, so I'm going to merge it. That said, @untitaker is right about that this probably is better solved with an extension.

mitsuhiko added a commit that referenced this pull request Mar 31, 2015
Set Command __doc__ string from the callback so Sphinx docs look nicer
@mitsuhiko
mitsuhiko merged commit 2cb7606 into pallets:3.x-maintenance Mar 31, 2015
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 13, 2020
@kdeldycke kdeldycke added this to the 4.0 milestone Aug 8, 2026
@kdeldycke kdeldycke added the docs Updates to documentation, readme, docstrings, typos label Aug 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

docs Updates to documentation, readme, docstrings, typos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants