private static IParsingResult GetParseResult(OptionInfo <string> optionInfo, OptionData optionData) { ParsingResult <string> result = ParsingResult <string> .SuccessfulResult(optionData.Data.FirstOrDefault()); if (optionData.Data.Count > 1) { result = ParsingResult <string> .FailedResult($"Error: {optionInfo.Name} can only be specified once"); } return(optionInfo.Parse(new SuccessfulResultCollection(optionInfo, result))); }
private static IParsingResult GetParseResult(OptionInfo <List <string> > multiOptionInfo, OptionData optionData) { return(multiOptionInfo.Parse(new SuccessfulResultCollection(multiOptionInfo, ParsingResult <List <string> > .SuccessfulResult(optionData.Data)))); }
private static IParsingResult GetParseResult(OptionInfo <List <string> > multiOptionInfo, OptionData optionData) { return(multiOptionInfo.Parse(new SuccessfulResultCollection(multiOptionInfo, ParsingResult <List <string> > .SuccessfulResult(optionData.Data.Select(list => list.FirstOrDefault()).ToList())))); }