Coverage for docs_src/multiple_values/options_with_multiple_values/tutorial001_an.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-12-19 20:29 +0000

1from typing import Tuple 1abcdefghi

2 

3import typer 1abcdefghi

4from typing_extensions import Annotated 1abcdefghi

5 

6app = typer.Typer() 1abcdefghi

7 

8 

9@app.command() 1abcdefghi

10def main(user: Annotated[Tuple[str, int, bool], typer.Option()] = (None, None, None)): 1abcdefghi

11 username, coins, is_wizard = user 1abcdefghi

12 if not username: 1abcdefghi

13 print("No user provided") 1abcdefghi

14 raise typer.Abort() 1abcdefghi

15 print(f"The username {username} has {coins} coins") 1abcdefghi

16 if is_wizard: 1abcdefghi

17 print("And this user is a wizard!") 1abcdefghi

18 

19 

20if __name__ == "__main__": 1abcdefghi

21 app() 1abcdefghi