Closed
Description
It would be cool if I can use the unparsed string with the parser again.
e.g.
public static string[] FormatCommandLineArgs<T>(this Parser parser, T options, Action<UnParserSettings> configuration)
If the options instance is manually created, it would be possible to let commandline
handle some default stuff:
public async Task RunAsync(string[] args)
{
var parserResult = _parser.ParseArguments<MyOptions1, MyOptions2, MyOptions3>(args);
await parserResult.MapResult(
async (MyOptions1 opts) => await Run1Async(opts),
async (MyOptions2 opts) => await Run2Async(opts),
async (MyOptions3 opts) => await Run3Async(opts),
async (IEnumerable<Error> errors) => await HandleParseErrorAsync(errors));
}
public async Task RunWithOptionsAsync<T>(T options)
{
string[] unparsedArgs = _parser.FormatCommandLineArgs(options);
await RunAsync(unparsedArgs);
}