Coverage for tests/assets/cli/rich_formatted_app.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-04-14 00:18 +0000

1import typer 1iabcdefgh

2from typing_extensions import Annotated 1iabcdefgh

3 

4app = typer.Typer(rich_markup_mode="rich") 1iabcdefgh

5 

6 

7@app.command(help="Say [bold red]hello[/bold red] to the user.") 1iabcdefgh

8def hello( 1abcdefgh

9 user_1: Annotated[ 

10 str, 

11 typer.Argument(help="The [bold]cool[/bold] name of the [green]user[/green]"), 

12 ], 

13 user_2: Annotated[str, typer.Argument(help="The world")] = "The World", 

14 force: Annotated[ 

15 bool, typer.Option(help="Force the welcome [red]message[/red]") 

16 ] = False, 

17): 

18 print(f"Hello {user_1} and {user_2}") # pragma: no cover 

19 

20 

21if __name__ == "__main__": 1iabcdefgh

22 app()