Coverage for docs_src/options/name/tutorial005.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-04-14 00:18 +0000

1import typer 1iabcdefgh

2 

3 

4def main( 1abcdefgh

5 name: str = typer.Option(..., "--name", "-n"), 

6 formal: bool = typer.Option(False, "--formal", "-f"), 

7): 

8 if formal: 1iabcdefgh

9 print(f"Good day Ms. {name}.") 1iabcdefgh

10 else: 

11 print(f"Hello {name}") 1iabcdefgh

12 

13 

14if __name__ == "__main__": 1iabcdefgh

15 typer.run(main) 1iabcdefgh