private static IEnumerable <ParsedOption> SafeExpand(Option matchedOption, ParsedOption parsedOption, IParser parser, List <string> diagnostics) { try { return(matchedOption.Expand(parsedOption.Value)); } catch (Exception e) { diagnostics.Add(Inv("Could not expand option [[ {0} ]]. Error message: {1}", parser.RenderSingleOption(parsedOption), e.GetLogEventMessage())); return(ParsedOption.EmptyCollection); } }
public static string RenderSingleOption(this IParser parser, ParsedOption option) { return(parser.RenderSingleOption(option.PrefixKind, option.Key, option.Value)); }