Exception thrown when there is an error parsing the command-line
Inheritance: System.Exception
示例#1
0
文件: Parser.cs 项目: newbish/hfmcmd
        /// <summary>
        /// Parse the supplied list of arguments, using the argument definitions
        /// given at construction.
        /// </summary>
        /// <returns>Null if we displayed usage instructions, otherwise a
        /// Dictionary of keys matching each argument found or defaulted,
        /// whose values are the string value of the argument for non-flag
        /// args, or a boolean value for flag args.
        /// </returns>
        public Dictionary<string, object> Parse(List<string> args)
        {
            Dictionary<string, object> result = null;

            ShowUsage = false;
            ParseException = null;

            _log.Fine("Parsing command-line arguments...");

            // Classify the command-line entries passed to the program
            ClassifyArguments(args);

            try {
                result = ProcessArguments();
            }
            catch(ParseException ex) {
                ParseException = ex;
            }

            return result;
        }