private bool DoParseArguments(string[] args, object options) { bool hadError = false; var optionMap = OptionInfo.CreateMap(options, _settings); var target = new TargetWrapper(options); IArgumentEnumerator arguments = new StringArrayEnumerator(args); while (arguments.MoveNext()) { string argument = arguments.Current; if (argument != null && argument.Length > 0) { ArgumentParser parser = ArgumentParser.Create(argument); //, target); if (parser != null) { ParserState result = parser.Parse(arguments, optionMap, options); if ((result & ParserState.Failure) == ParserState.Failure) { hadError = true; break; } if ((result & ParserState.MoveOnNextElement) == ParserState.MoveOnNextElement) arguments.MoveNext(); } else if (target.IsValueListDefined) { if (!target.AddValueItemIfAllowed(argument)) { hadError = true; break; } } } } hadError |= !optionMap.EnforceRules(); return !hadError; }