-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Bug: CSV Headers Printed Repeatedly During Pagination #44
Copy link
Copy link
Closed
Description
Pattern: Edge cases surrounding formatting logic interfacing with the CLI's pagination behavior.
Findings:
In formatter.rs::format_csv, the CSV headers are hardcoded to be printed at the top of the output string on every format execution:
let _ = writeln!(output, "{}", columns.join(","));Because the executor.rs processes pages in loop batches when the --page-all flag is specified, format_csv gets called repeatedly. This results in the CSV header row being printed out multiple times in the middle of the document at every page boundary.
Recommendation: Pass a flag or context to output formatters indicating is_first_page, or extract the header rendering logic to a separate dedicated step for tabular outputs so it only writes once at the start of loop processing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels