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

8 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 18:26 +0000

1import typer 1abcdefgh

2 

3app = typer.Typer() 1abcdefgh

4 

5 

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

7def create(username: str): 1abcdefgh

8 """ 

9 Some internal utility function to create. 

10 """ 

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

12 

13 

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

15def delete(username: str): 1abcdefgh

16 """ 

17 Some internal utility function to delete. 

18 """ 

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

20 

21 

22if __name__ == "__main__": 1abcdefgh

23 app() 1abcdefgh