Coverage for docs_src/commands/context/tutorial004.py: 100%
6 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
1import typer 1abcdefgh
3app = typer.Typer() 1abcdefgh
6@app.command( 1abcdefgh
7 context_settings={"allow_extra_args": True, "ignore_unknown_options": True}
8)
9def main(ctx: typer.Context): 1abcdefgh
10 for extra_arg in ctx.args: 1abcdefgh
11 print(f"Got extra arg: {extra_arg}") 1abcdefgh
14if __name__ == "__main__": 1abcdefgh
15 app() 1abcdefgh