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

No --help flag in CLI doc. #148

Open
KalebCoberly opened this issue Jan 14, 2025 · 0 comments
Open

No --help flag in CLI doc. #148

KalebCoberly opened this issue Jan 14, 2025 · 0 comments

Comments

@KalebCoberly
Copy link

The doc output for the click directive includes the args I add, but not the --help flag.

For instance, with this example:

@click.command()
@click.option(
    "--secs", type=int, required=False, default=1, help="Number of seconds to wait."
)
@typechecked
def main(secs: int = 1) -> None:
    """Wait n seconds."""
    example.wait_a_second(secs=secs)

I include the click directive in a doc:

.. click:: reference_package.cli.example:main
   :prog: example
   :nested: full

And, I only get the --secs arg in my doc.

But, of course, --help is a legit flag, and it shows up when using itself:

$ example --help
Usage: example [OPTIONS]

  Wait n seconds.

Options:
  --secs INTEGER  Number of seconds to wait.
  --help          Show this message and exit.

My users are inexperienced and may not always know/remember that --help is a thing. I can manually add an example of using --help to every doc, but is there a way to include --help in the doc output for the click directive?

Versions:

  • Python: 3.12
  • click: 8.1.8
  • sphinx-click 6.0.0
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