Coverage for docs_src/subcommands/name_help/tutorial003.py: 100%

8 statements  

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

1import typer 1abcdefgh

2 

3app = typer.Typer() 1abcdefgh

4 

5 

6def users(): 1abcdefgh

7 """ 

8 Manage users in the app. 

9 """ 

10 

11 

12users_app = typer.Typer(callback=users) 1abcdefgh

13app.add_typer(users_app) 1abcdefgh

14 

15 

16@users_app.command() 1abcdefgh

17def create(name: str): 1abcdefgh

18 print(f"Creating user: {name}") 1abcdefgh

19 

20 

21if __name__ == "__main__": 1abcdefgh

22 app() 1abcdefgh