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

9 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-04-14 00:18 +0000

1import typer 1iabcdefgh

2 

3app = typer.Typer() 1iabcdefgh

4 

5users_app = typer.Typer() 1iabcdefgh

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

7 

8 

9@users_app.callback() 1iabcdefgh

10def users(): 1abcdefgh

11 """ 

12 Manage users in the app. 

13 """ 

14 

15 

16@users_app.command() 1iabcdefgh

17def create(name: str): 1iabcdefgh

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

19 

20 

21if __name__ == "__main__": 1iabcdefgh

22 app() 1iabcdefgh