Coverage for docs_src/first_steps/tutorial006.py: 100%
5 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
1import typer 1abcdefgh
4def main(name: str, lastname: str = "", formal: bool = False): 1abcdefgh
5 """
6 Say hi to NAME, optionally with a --lastname.
8 If --formal is used, say hi very formally.
9 """
10 if formal: 1abcdefgh
11 print(f"Good day Ms. {name} {lastname}.") 1abcdefgh
12 else:
13 print(f"Hello {name} {lastname}") 1abcdefgh
16if __name__ == "__main__": 1abcdefgh
17 typer.run(main) 1abcdefgh