File: typing_confirmation_option.py

package info (click to toggle)
python-asyncclick 8.1.8.0%2Basync-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,444 kB
  • sloc: python: 11,700; makefile: 22; sh: 10
file content (14 lines) | stat: -rw-r--r-- 326 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"""From https://click.palletsprojects.com/en/8.1.x/options/#yes-parameters"""

from typing_extensions import assert_type

import click


@click.command()
@click.confirmation_option(prompt="Are you sure you want to drop the db?")
def dropdb() -> None:
    click.echo("Dropped all tables!")


assert_type(dropdb, click.Command)