tests/typing/typing_confirmation_option.py
raw| 1 | """From https://click.palletsprojects.com/en/stable/options/#yes-parameters""" |
| 2 | |
| 3 | from typing_extensions import assert_type |
| 4 | |
| 5 | import asyncclick as click |
| 6 | |
| 7 | |
| 8 | @click.command() |
| 9 | @click.confirmation_option(prompt="Are you sure you want to drop the db?") |
| 10 | def dropdb() -> None: |
| 11 | click.echo("Dropped all tables!") |
| 12 | |
| 13 | |
| 14 | assert_type(dropdb, click.Command) |