Print a simple box panel without rich (saves 112ms import).
(title: str, lines: list[str])
| 2 | |
| 3 | |
| 4 | def _print_panel(title: str, lines: list[str]) -> None: |
| 5 | """Print a simple box panel without rich (saves 112ms import).""" |
| 6 | all_lines = [title, ""] + lines |
| 7 | width = max(len(line) for line in all_lines) + 4 |
| 8 | border = "-" * width |
| 9 | print(f"\n+{border}+") |
| 10 | print(f"| {title:<{width - 2}} |") |
| 11 | print(f"|{' ' * width}|") |
| 12 | for line in lines: |
| 13 | print(f"| {line:<{width - 3}} |") |
| 14 | print(f"+{border}+\n") |
| 15 | |
| 16 | |
| 17 | def parse_args() -> tuple: |