예제 #1
0
        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)));
        }
예제 #2
0
 private static IParsingResult GetParseResult(OptionInfo <List <string> > multiOptionInfo, OptionData optionData)
 {
     return(multiOptionInfo.Parse(new SuccessfulResultCollection(multiOptionInfo, ParsingResult <List <string> > .SuccessfulResult(optionData.Data))));
 }
예제 #3
0
 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()))));
 }