Coverage for docs_src / options_autocompletion / tutorial002_non_an.py: 100%
7 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-11-18 11:12 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-11-18 11:12 +0000
1import typer 1abcdefghij
4def complete_name(): 1abcdefghij
5 return ["Camila", "Carlos", "Sebastian"] 1abcdefghij
8app = typer.Typer() 1abcdefghij
11@app.command() 1abcdefghij
12def main( 1abcdefghij
13 name: str = typer.Option(
14 "World", help="The name to say hi to.", autocompletion=complete_name
15 ),
16):
17 print(f"Hello {name}") 1abcdefghij
20if __name__ == "__main__": 1abcdefghij
21 app() 1abcdefghij