Coverage for docs_src / commands / help / tutorial005_non_an.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(rich_markup_mode="markdown") 1abcdefghij

4 

5 

6@app.command() 1abcdefghij

7def create(username: str = typer.Argument(..., help="The username to be **created**")): 1abcdefghij

8 """ 

9 **Create** a new *shiny* user. :sparkles: 

10 

11 * Create a username 

12 

13 * Show that the username is created 

14 

15 --- 

16 

17 Learn more at the [Typer docs website](https://typer.tiangolo.com) 

18 """ 

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

20 

21 

22@app.command(help="**Delete** a user with *username*.") 1abcdefghij

23def delete( 1abcdefghij

24 username: str = typer.Argument(..., help="The username to be **deleted**"), 

25 force: bool = typer.Option(False, help="Force the **deletion** :boom:"), 

26): 

27 """ 

28 Some internal utility function to delete. 

29 """ 

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

31 

32 

33if __name__ == "__main__": 1abcdefghij

34 app() 1abcdefghij