Skip to content

Enhancement: Extend csv output mode to include more properties than text output mode #4150

Closed
@martinlingstuyl

Description

@martinlingstuyl

The csv output mode is currently restricted to return the properties that are also returned in text mode.

For example, the following will force csv output mode to return just three columns.

public defaultProperties(): string[] | undefined {
    return ['id', 'displayName', 'isInUse'];
}

The problem with this is that the defaultProperties have been limited on purpose because text mode is ugly when too many properties are side by side. CSV however is not limited by the breadth of the screen as these files are usually opened with a tool like excel. Also, you'd typically want more information than when compiling a csv.

💡Idea

What if we enhanced the csv output mode to return EVERY property from objects.
This would be problematic with nested objects, so those could be excluded automatically.

Another route would be to add an extra option: --csv-columns that allows people to write down a comma-separated list of columns they want to export to the csv. But maybe that's a bit too much, people can always use the JSON output mode and shell commands to create their own CSV file.

❗ Conclusion

This Issue is resolved when the CSV output mode includes ALL properties of the returned object.
Nested objects should be excluded by default, UNLESS when the --query JMESPath option is used to force return a selection of properties.
So we'll NOT add extra global options to influence the csv output.

For the MD output mode, I made a separate issue (#4150) , it might be that the change fixes it for both output modes. So here's a note to check that on review and if necessary close the other issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions