Skip to content

Conversation

willmurphyscode
Copy link
Contributor

For now, CSV output is the same as table output, but with commas.

For now, CSV output is the same as table output, but with commas.

Signed-off-by: Will Murphy <[email protected]>
@willmurphyscode willmurphyscode self-assigned this Jun 25, 2025
@willmurphyscode willmurphyscode added the enhancement New feature or request label Jun 25, 2025
@willmurphyscode willmurphyscode marked this pull request as ready for review June 25, 2025 18:21
@willmurphyscode willmurphyscode requested a review from a team June 25, 2025 18:21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is mostly a copy-paste of the table presenter. Are the display semantics similar enough to make the table presenter optionally output CSV?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that they are. For example, we want to pretty print EPSS percents and percentiles, but in the CSV we probably want them to be separate columns and printed as bare floats?


func (r row) Columns() []string {
columns := []string{
stripANSI(r.Name),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why call the format functions then strip ansi characters? We could not call the format functions at all. Or have an alternative style set that is structural only without any ANSI control characters.

@wagoodman wagoodman marked this pull request as draft July 2, 2025 17:04
Previous draft of this feature included the csv format in its own
present, but that is effectively just a copy of the table presenter with
a different separation strategy. Therefore, combine the csv and table
presenter so that if, for example, a new column needs to be added, it
only needs to be done in one please.

Signed-off-by: Will Murphy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants