Skip to content

add support for outputting content in different formats #166

Closed as not planned
@jonsequitur

Description

@jonsequitur

A useful capability would be a model whereby developers can set the output based on an object rather than explicitly writing text. We could provide a number of ways of representing that output so that the end user can expect consistent behaviors and choose output formats that suit their needs.

Here's an example of how this might work:

 var commandLine = new CommandLineBuilder()
                              .AddOutputFormat(OutputFormats.Json)
                              .AddOutputFormat(OutputFormats.Csv)
                              .AddOutputFormat(OutputFormats.TabDelimited)
                              .AddOutputFormat(OutputFormats.Xml);

The above would also add an option that would be visible in help:

>my.exe -h

Options:
  --format [json|csv|tab-delimited|xml]        Specifies the output format. 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions