Пример #1
0
 /// <summary>
 /// Checks if a set of arguments asks for help.
 /// </summary>
 /// <param name="args"> Args to check for help. </param>
 /// <returns> Returns true if args contains /? or /help. </returns>
 public static bool ParseHelp(string[] args)
 {
     Parser helpParser = new Parser(typeof(HelpArgument), new ErrorReporter(NullErrorReporter));
     HelpArgument helpArgument = new HelpArgument();
     helpParser.Parse(args, helpArgument);
     return helpArgument.help;
 }
Пример #2
0
 /// <summary>
 /// Parses Command Line Arguments. 
 /// Use ArgumentAttributes to control parsing behaviour.
 /// </summary>
 /// <param name="arguments"> The actual arguments. </param>
 /// <param name="destination"> The resulting parsed arguments. </param>
 /// <param name="reporter"> The destination for parse errors. </param>
 /// <returns> true if no errors were detected. </returns>
 public static bool ParseArguments(string[] arguments, object destination, ErrorReporter reporter)
 {
     Parser parser = new Parser(destination.GetType(), reporter);
     return parser.Parse(arguments, destination);
 }