Skip to content
Myr

Add example for Group Help Page in documentation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Anurag Saxena · committed by Anurag Saxena · parent bee3314 · Browse files · 1 file+40 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+40 added−0 removed

  • other:+40 added−0 removed

1 file+40 added−0 removed

modified:docs/documentation.md+40 added
48 unmodified lines
49.. click:run::50 invoke(cli, args=['--help'])51```5253## Group Help Page5455The group help prints sub commands, options, epilog help, and arguments, and prints them together.5657```{eval-rst}58.. click:example::5960 import click6162 @click.group(63 help="Example Click app with subcommands, options, and positional arguments.",64 epilog=("Examples:\n\n\b\n python hello.py greet Alice --count 2\n"),65 )66 def cli() -> None:67 """Run the example CLI."""6869 @cli.command()70 @click.argument("name")71 @click.option(72 "--count",73 default=1,74 show_default=True,75 type=click.IntRange(1, None),76 help="Number of greetings to print.",77 )78 @click.option(79 "--greeting",80 default="Hello",81 show_default=True,82 help="Greeting prefix to use.",83 )84 def greet(name: str, count: int, greeting: str) -> None:85 """Greet NAME one or more times."""86 for _ in range(count):87 click.echo(f"{greeting} {name}!")8889.. click:run::90 invoke(init, args=['--help'])91```9293## Command Epilog Help9495The help epilog is printed at the end of the help and is useful for showing example command usages or referencing additional help resources.96
237 unmodified lines