Coverage for docs_src / commands / help / tutorial005_py39.py: 100%
8 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-02-09 12:36 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-02-09 12:36 +0000
1import typer 1abcdefgh
3app = typer.Typer(rich_markup_mode="markdown") 1abcdefgh
6@app.command() 1abcdefgh
7def create(username: str = typer.Argument(..., help="The username to be **created**")): 1abcdefgh
8 """
9 **Create** a new *shiny* user. :sparkles:
11 * Create a username
13 * Show that the username is created
15 ---
17 Learn more at the [Typer docs website](https://typer.tiangolo.com)
18 """
19 print(f"Creating user: {username}") 1abcdefgh
22@app.command(help="**Delete** a user with *USERNAME*.") 1abcdefgh
23def delete( 1abcdefgh
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}") 1abcdefgh
33if __name__ == "__main__": 1abcdefgh
34 app() 1abcdefgh