Beispiel #1
0
        static void Main(string[] args)
        {
            try
            {
                AttachConsole(-1);
            }
            catch (Exception)
            {
                Console.WriteLine("Couldn't redirect console. Nevermind");
            }

            Startup.PreStartup();

            UsefulStuff.GetParser()
            .ParseArguments <ResearchDataManagementPlatformOptions>(args)
            .MapResult(RunApp, err => - 1);
        }
Beispiel #2
0
        private static int HandleArguments(string[] args, Logger logger)
        {
            try
            {
                var returnCode =
                    UsefulStuff.GetParser()
                    .ParseArguments <
                        DleOptions,
                        DqeOptions,
                        CacheOptions,
                        ExtractionOptions,
                        ReleaseOptions,
                        CohortCreationOptions,
                        PackOptions,
                        ExecuteCommandOptions,
                        ConsoleGuiOptions,
                        PlatformDatabaseCreationOptions,
                        PatchDatabaseOptions>(args)
                    .MapResult(
                        //Add new verbs as options here and invoke relevant runner
                        (DleOptions opts) => Run(opts),
                        (DqeOptions opts) => Run(opts),
                        (CacheOptions opts) => Run(opts),
                        (ExtractionOptions opts) => Run(opts),
                        (ReleaseOptions opts) => Run(opts),
                        (CohortCreationOptions opts) => Run(opts),
                        (PackOptions opts) => Run(opts),
                        (PlatformDatabaseCreationOptions opts) => Run(opts),
                        (ExecuteCommandOptions opts) => RunCmd(opts),
                        (ConsoleGuiOptions opts) => Run(opts),
                        (PatchDatabaseOptions opts) => Run(opts),
                        errs => 1);

                logger.Info("Exiting with code " + returnCode);
                return(returnCode);
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                logger.Info(e, "Fatal error occurred so returning -1");
                return(-1);
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            if (args.Any(a => a.Equals("--squirrel-install", StringComparison.InvariantCultureIgnoreCase)))
            {
                return;
            }

            try
            {
                AttachConsole(-1);
            }
            catch (Exception)
            {
                Console.WriteLine("Couldn't redirect console. Nevermind");
            }

            UsefulStuff.GetParser()
            .ParseArguments <ResearchDataManagementPlatformOptions>(args.Except(new[] { "--squirrel-firstrun" }))
            .MapResult(RunApp, err => - 1);
        }