Print a tab-separated table for pipe-friendly output.
(
headers: list[str],
rows: list[list[str]],
title: str | None = None,
header: bool = True,
)
| 171 | |
| 172 | |
| 173 | def print_plain_table( |
| 174 | headers: list[str], |
| 175 | rows: list[list[str]], |
| 176 | title: str | None = None, |
| 177 | header: bool = True, |
| 178 | ) -> None: |
| 179 | """Print a tab-separated table for pipe-friendly output.""" |
| 180 | if title: |
| 181 | print(title) |
| 182 | if header: |
| 183 | print("\t".join(headers)) |
| 184 | for row in rows: |
| 185 | print("\t".join(sanitize_tsv("" if cell is None else str(cell)) for cell in row)) |
| 186 | |
| 187 | |
| 188 | # Keep alias for backward compatibility |