Coverage for docs_src/multiple_values/options_with_multiple_values/tutorial001.py: 100%
10 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
1from typing import Tuple 1abcdefgh
3import typer 1abcdefgh
6def main(user: Tuple[str, int, bool] = typer.Option((None, None, None))): 1abcdefgh
7 username, coins, is_wizard = user 1abcdefgh
8 if not username: 1abcdefgh
9 print("No user provided") 1abcdefgh
10 raise typer.Abort() 1abcdefgh
11 print(f"The username {username} has {coins} coins") 1abcdefgh
12 if is_wizard: 1abcdefgh
13 print("And this user is a wizard!") 1abcdefgh
16if __name__ == "__main__": 1abcdefgh
17 typer.run(main) 1abcdefgh