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

8 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 

5 

6@app.command() 1abcdefghij

7def create(username: str): 1abcdefghij

8 """ 

9 Create a user. 

10 """ 

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

12 

13 

14@app.command(deprecated=True) 1abcdefghij

15def delete(username: str): 1abcdefghij

16 """ 

17 Delete a user. 

18 

19 This is deprecated and will stop being supported soon. 

20 """ 

21 print(f"Deleting user: {username}") 1abcdefghij

22 

23 

24if __name__ == "__main__": 1abcdefghij

25 app() 1abcdefghij