Ejemplo n.º 1
0
        // Defines the standard command-line arguments
        protected void SetupCommandLine()
        {
            ValueArgument arg = _cmdLine.AddPositionalArgument("CommandOrFile",
                                                               "The name of the command to execute, or the path to a file containing commands to execute");

            arg.IsRequired = true;
            arg.Validate   = ValidateCommand;

            arg = _cmdLine.AddKeywordArgument("LogLevel", "Set logging to the specified log level",
                                              (_, val) => Log(val, null));
            arg.AddValidator(new ListValidator("NONE", "SEVERE", "ERROR", "WARN",
                                               "INFO", "FINE", "TRACE", "DEBUG"));

            _cmdLine.AddFlagArgument("Debug", "Enable debug logging",
                                     (_, val) => Log("DEBUG", null));
        }