| 1 |
"""The simple example from https://github.com/pallets/click#a-simple-example.""" |
| 2 |
|
| 3 |
from typing_extensions import assert_type |
| 4 |
|
| 5 |
import asyncclick as click |
| 6 |
|
| 7 |
|
| 8 |
@click.command() |
| 9 |
@click.option("--count", default=1, help="Number of greetings.") |
| 10 |
@click.option("--name", prompt="Your name", help="The person to greet.") |
| 11 |
def hello(count: int, name: str) -> None: |
| 12 |
"""Simple program that greets NAME for a total of COUNT times.""" |
| 13 |
for _ in range(count): |
| 14 |
click.echo(f"Hello, {name}!") |
| 15 |
|
| 16 |
|
| 17 |
assert_type(hello, click.Command) |