Coverage for docs_src/commands/help/tutorial006.py: 100%
20 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-04-14 00:18 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-04-14 00:18 +0000
1import typer 1iabcdefgh
3app = typer.Typer(rich_markup_mode="rich") 1iabcdefgh
6@app.command() 1iabcdefgh
7def create(username: str): 1iabcdefgh
8 """
9 [green]Create[/green] a new user. :sparkles:
10 """
11 print(f"Creating user: {username}") 1iabcdefgh
14@app.command() 1iabcdefgh
15def delete(username: str): 1iabcdefgh
16 """
17 [red]Delete[/red] a user. :fire:
18 """
19 print(f"Deleting user: {username}") 1iabcdefgh
22@app.command(rich_help_panel="Utils and Configs") 1iabcdefgh
23def config(configuration: str): 1iabcdefgh
24 """
25 [blue]Configure[/blue] the system. :wrench:
26 """
27 print(f"Configuring the system with: {configuration}") 1iabcdefgh
30@app.command(rich_help_panel="Utils and Configs") 1iabcdefgh
31def sync(): 1abcdefgh
32 """
33 [blue]Synchronize[/blue] the system or something fancy like that. :recycle:
34 """
35 print("Syncing the system") 1iabcdefgh
38@app.command(rich_help_panel="Help and Others") 1iabcdefgh
39def help(): 1abcdefgh
40 """
41 Get [yellow]help[/yellow] with the system. :question:
42 """
43 print("Opening help portal...") 1iabcdefgh
46@app.command(rich_help_panel="Help and Others") 1iabcdefgh
47def report(): 1abcdefgh
48 """
49 [yellow]Report[/yellow] an issue. :bug:
50 """
51 print("Please open a new issue online, not a direct message") 1iabcdefgh
54if __name__ == "__main__": 1iabcdefgh
55 app() 1iabcdefgh