I am using the commandline parser to parse 2 verbs. Here is a code snippet:
[Verb("Option1")]
public class VerbOption1
{
[Option('o', "option1")]
public string Option1 { get; set; }
}
[Verb("Option2")]
public class VerbOption2
{
[Option('t', "option2")]
public string Option2 { get; set; }
}
Parser.Default.ParseArguments<VerbOption1, VerbOption2>(args)
.WithParsed<VerbOption1>(option1 => doSomething(option1))
.WithParsed<VerbOption2>(option2 => doSomethingElse(option2));
The issue I am having is that I get an error saying that verb 'x' is not recognized. If I only use 1 verb, then it works. But as soon as I add a second verb I get this error.
Can anyone help to clarify what's happening and how I can resolve this error?
Any hep would be much appreciated.
Thanks