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

8 statements  

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

1import typer 1abcdefghi

2 

3app = typer.Typer() 1abcdefghi

4 

5 

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

7def create(username: str): 1abcdefghi

8 """ 

9 Some internal utility function to create. 

10 """ 

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

12 

13 

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

15def delete(username: str): 1abcdefghi

16 """ 

17 Some internal utility function to delete. 

18 """ 

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

20 

21 

22if __name__ == "__main__": 1abcdefghi

23 app() 1abcdefghi