Skip to content

Bug: CSV Headers Printed Repeatedly During Pagination #44

@jpoehnelt

Description

@jpoehnelt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions