Typer command wrapper.
(**kwargs)
| 71 | |
| 72 | # Create the wrapper function |
| 73 | def wrapper(**kwargs): |
| 74 | """Typer command wrapper.""" |
| 75 | # Run the async command synchronously |
| 76 | result = asyncio.run( |
| 77 | CLICommandAdapter._execute_command(command, kwargs) |
| 78 | ) |
| 79 | |
| 80 | # Handle result |
| 81 | if result.success: |
| 82 | if result.output: |
| 83 | output.print(result.output) |
| 84 | else: |
| 85 | if result.error: |
| 86 | output.error(result.error) |
| 87 | raise typer.Exit(code=1) |
| 88 | |
| 89 | # Set function annotations for Typer |
| 90 | wrapper.__annotations__ = annotations |
nothing calls this directly
no test coverage detected