Coverage for tests / assets / completion_no_types.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-02-09 12:36 +0000

1import typer 1abcdefgh

2 

3app = typer.Typer() 1abcdefgh

4 

5 

6def complete(ctx, args, incomplete): 1abcdefgh

7 typer.echo(f"info name is: {ctx.info_name}", err=True) 1abcdefgh

8 typer.echo(f"args is: {args}", err=True) 1abcdefgh

9 typer.echo(f"incomplete is: {incomplete}", err=True) 1abcdefgh

10 return [ 1abcdefgh

11 ("Camila", "The reader of books."), 

12 ("Carlos", "The writer of scripts."), 

13 ("Sebastian", "The type hints guy."), 

14 ] 

15 

16 

17@app.command() 1abcdefgh

18def main(name: str = typer.Option("World", autocompletion=complete)): 1abcdefgh

19 print(f"Hello {name}") 1abcdefgh

20 

21 

22if __name__ == "__main__": 1abcdefgh

23 app() 1abcdefgh