Coverage for docs_src / parameter_types / bool / tutorial002_py310.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-02-09 12:36 +0000

1import typer 1abcdefg

2 

3app = typer.Typer() 1abcdefg

4 

5 

6@app.command() 1abcdefg

7def main(accept: bool | None = typer.Option(None, "--accept/--reject")): 1abcdefg

8 if accept is None: 1abcdefg

9 print("I don't know what you want yet") 1abcdefg

10 elif accept: 1abcdefg

11 print("Accepting!") 1abcdefg

12 else: 

13 print("Rejecting!") 1abcdefg

14 

15 

16if __name__ == "__main__": 1abcdefg

17 app() 1abcdefg