Example #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");
            }
        }
Example #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);
        }
Example #3
0
        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);
        }