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

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 18:26 +0000

1from typing import Optional 1abcdefgh

2 

3import typer 1abcdefgh

4 

5 

6def main(accept: Optional[bool] = typer.Option(None, "--accept/--reject")): 1abcdefgh

7 if accept is None: 1abcdefgh

8 print("I don't know what you want yet") 1abcdefgh

9 elif accept: 1abcdefgh

10 print("Accepting!") 1abcdefgh

11 else: 

12 print("Rejecting!") 1abcdefgh

13 

14 

15if __name__ == "__main__": 1abcdefgh

16 typer.run(main) 1abcdefgh