Example #1
0
        public void AddError(ParsingError error)
        {
            if (error == null)
                throw new ArgumentNullException("error");

            lock (SyncObject)
            {
                ParsingErrors.Add(error);
            }
        }
Example #2
0
        private static void BuildAndSetPostParsingStateIfNeeded(object options, OptionInfo option, bool? required, bool? mutualExclusiveness)
        {
            var commandLineOptionsBase = options as CommandLineOptionsBase;
            if (commandLineOptionsBase == null)
                return;

            var error = new ParsingError {
                                             BadOption = {
                                                             ShortName = option.ShortName,
                                                             LongName = option.LongName
                                                         }
                                         };

            if (required != null)
                error.ViolatesRequired = required.Value;
            if (mutualExclusiveness != null)
                error.ViolatesMutualExclusiveness = mutualExclusiveness.Value;

            (commandLineOptionsBase).InternalLastPostParsingState.AddError(error);
        }