Coverage for docs_src/commands/context/tutorial004.py: 100%
6 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 1abcdefghi
3app = typer.Typer() 1abcdefghi
6@app.command( 1abcdefghi
7 context_settings={"allow_extra_args": True, "ignore_unknown_options": True}
8)
9def main(ctx: typer.Context): 1abcdefghi
10 for extra_arg in ctx.args: 1abcdefghi
11 print(f"Got extra arg: {extra_arg}") 1abcdefghi
14if __name__ == "__main__": 1abcdefghi
15 app() 1abcdefghi