I've got this RootCommand:
var rootCommand = new RootCommand()
{
new Argument<string>("search","string to search for")
,new Option<string>(new []{"--path","-p"},getDefaultValue:()=>Directory.GetCurrentDirectory(),"path where to search")
,new Option<string[]>(new []{"-f","--files"},"file pattern to match to search in"){ Argument=new Argument<string[]>(getDefaultValue:()=>new[]{"*.*"}){Arity=ArgumentArity.ZeroOrMore} }
};
the option -f is supposed to take zero or more values, but in the handler defined as below:
rootCommand.Handler= CommandHandler.Create<string,string,string[]>(async (search,path,filepattern)=> {
filepattern is always null, even if I call with, for instance -f *.cs
.
What I'm missing?