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

9 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 

5users_app = typer.Typer() 1abcdefghij

6app.add_typer(users_app, name="users") 1abcdefghij

7 

8 

9@users_app.callback() 1abcdefghij

10def users(): 1abcdefghij

11 """ 

12 Manage users in the app. 

13 """ 

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