static void Main(string[] args) { if (args.Length > 0 && args[0] == "ExtractProjectList") { ExtractProjectListCommand command = new ExtractProjectListCommand(); command.Execute(args); } else if (args.Length > 0 && args[0] == "ExtractBuildMachineList") { ExtractBuildMachineListCommand command = new ExtractBuildMachineListCommand(); command.Execute(args); } }
static void Main(string[] args) { Logger logger = LogManager.GetCurrentClassLogger(); var options = new CommandLineOptions(); bool processed = false; if (CommandLine.Parser.Default.ParseArguments(args, options)) { processed = (options.extractProjects || options.extractMachines || options.extractUsers) == true; if (options.extractProjects == true) { logger.Info("Extract Projects"); iCommand command = new ExtractProjectListCommand(); command.Execute(); } if (options.extractMachines == true) { logger.Info("Extract Build Machines"); iCommand command = new ExtractBuildMachineListCommand(); command.Execute(); } if (options.extractUsers == true) { logger.Info("Extract users"); logger.Warn("that's a quite long process"); if (options.extractUOFromAD) { logger.Warn("especially with the AD query"); } iCommand command = new ExtractUsersListCommand(options.extractUOFromAD); command.Execute(); } } if (processed == false) { Console.Write(options.GetUsage()); Console.ReadKey(); } }