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

8 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-11-18 11:12 +0000

1import typer 1abcdefghij

2 

3app = typer.Typer() 1abcdefghij

4 

5 

6def users(): 1abcdefghij

7 """ 

8 Manage users in the app. 

9 """ 

10 

11 

12users_app = typer.Typer(callback=users, name="users") 1abcdefghij

13app.add_typer(users_app) 1abcdefghij

14 

15 

16@users_app.command() 1abcdefghij

17def create(name: str): 1abcdefghij

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

19 

20 

21if __name__ == "__main__": 1abcdefghij

22 app() 1abcdefghij