Multiple Options class instances

Oct 19, 2016 at 7:01 AM

I was wondering if there is a recommended approach if we need to handle multiple options classes:

e.g. something like:
class Options1 : IOptions {
  [Option('r', "read", Required = true, HelpText = "Input file to be processed.")]
  public string InputFile { get; set; }

class Options2 : IOptions {
  [Option('v', "verbose", DefaultValue = true, HelpText = "Prints all messages to standard output.")]
  public bool Verbose { get; set; }
I need to be able to generate a single HelpText from all Options classes and parse the command line args into all Options classes.

The options number of options classes depend on what features were selected during installation and are generally discovered via MEF.

Is there a nice way to do this?