예제 #1
0
        private static void startCommand <TRunOptions>(CLICommand <TRunOptions> command)
        {
            var logger = initializeLogger(command);

            if (command.LogCommandName)
            {
                logger.AddInfo($"Starting {command.Name.ToLower()} run");
            }

            logger.AddDebug($"Arguments:\n{command}");
            ApplicationStartup.Start();
            var runner = IoC.Resolve <IBatchRunner <TRunOptions> >();

            try
            {
                runner.RunBatchAsync(command.ToRunOptions()).Wait();
            }
            catch (Exception e)
            {
                logger.AddException(e);
                _valid = false;
            }

            if (command.LogCommandName)
            {
                logger.AddInfo($"{command.Name} run finished");
            }
        }
예제 #2
0
        static int Main(string[] args)
        {
            ApplicationStartup.Initialize();

            Parser.Default.ParseArguments <JsonRunCommand, SnapshotRunCommand, ExportRunCommand, QualificationRunCommand>(args)
            .WithParsed <JsonRunCommand>(startCommand)
            .WithParsed <SnapshotRunCommand>(startCommand)
            .WithParsed <ExportRunCommand>(startCommand)
            .WithParsed <QualificationRunCommand>(startCommand)
            .WithNotParsed(err => _valid = false);

            if (!_valid)
            {
                return((int)ExitCodes.Error);
            }

            return((int)ExitCodes.Success);
        }
예제 #3
0
파일: Program.cs 프로젝트: yvkashyap/PK-Sim
        static int Main(string[] args)
        {
            //starting batch tool with arguments
            var valid = true;

            ApplicationStartup.Initialize();

            Parser.Default.ParseArguments <JsonRunCommand, SnapshotRunCommand, ExportRunCommand>(args)
            .WithParsed <JsonRunCommand>(startCommand)
            .WithParsed <SnapshotRunCommand>(startCommand)
            .WithParsed <ExportRunCommand>(startCommand)
            .WithNotParsed(err => valid = false);

            if (!valid)
            {
                return((int)ExitCodes.Error);
            }

            return((int)ExitCodes.Success);
        }