Coverage for docs_src / commands / help / tutorial002_py310.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-03-26 21:46 +0000

1import typer 1abcdefg

2 

3app = typer.Typer() 1abcdefg

4 

5 

6@app.command(help="Create a new user with USERNAME.") 1abcdefg

7def create(username: str): 1abcdefg

8 """ 

9 Some internal utility function to create. 

10 """ 

11 print(f"Creating user: {username}") 1abcdefg

12 

13 

14@app.command(help="Delete a user with USERNAME.") 1abcdefg

15def delete(username: str): 1abcdefg

16 """ 

17 Some internal utility function to delete. 

18 """ 

19 print(f"Deleting user: {username}") 1abcdefg

20 

21 

22if __name__ == "__main__": 1abcdefg

23 app() 1abcdefg