Coverage for docs_src / commands / context / tutorial004.py: 100%

6 statements  

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

1import typer 1abcdefghij

2 

3app = typer.Typer() 1abcdefghij

4 

5 

6@app.command( 1abcdefghij

7 context_settings={"allow_extra_args": True, "ignore_unknown_options": True} 

8) 

9def main(ctx: typer.Context): 1abcdefghij

10 for extra_arg in ctx.args: 1abcdefghij

11 print(f"Got extra arg: {extra_arg}") 1abcdefghij

12 

13 

14if __name__ == "__main__": 1abcdefghij

15 app() 1abcdefghij