Closed as not planned
Description
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.