Example #1
0
        static bool Redirect(string[] arguments, string contents)
        {
            DCInsideConsoleOption option = CommandLineParser <DCInsideConsoleOption> .Parse(arguments, contents != "", contents);

            if (option.Error)
            {
                Console.Instance.WriteLine(option.ErrorMessage);
                if (option.HelpMessage != null)
                {
                    Console.Instance.WriteLine(option.HelpMessage);
                }
                return(false);
            }
            else if (option.Help)
            {
                PrintHelp();
            }
            else if (option.Login != null)
            {
                ProcessLogin(option.Login);
            }
            else if (option.BuildMinorGallery)
            {
                ProcessBuildMinorGallery();
            }
            else if (option.FindGallery != null)
            {
                ProcessFindGallery(option.FindGallery);
            }
            else if (option.ParseGallery != null)
            {
                ProcessParseGallery(option.ParseGallery, option.FilterRecommend, option.FilterTitle,
                                    option.FilterNick, option.FilterIp, option.FilterId, option.FilterLogined, option.FilterFixed);
            }
            else if (option.FullParse != null)
            {
                ProcessFullParse(option.FullParse, option.FilterRecommend, option.FilterTitle,
                                 option.FilterNick, option.FilterIp, option.FilterId, option.FilterLogined, option.FilterFixed);
            }
            else if (option.CollectArticles != null)
            {
                ProcessCollectArticles(option.CollectArticles, option.FilterRecommend);
            }
            else if (option.ParseArticle != null)
            {
                ProcessParseArticle(option.ParseArticle);
            }
            else if (option.ParseComments != null)
            {
                ProcessParseComments(option.ParseComments);
            }
            else if (option.Test != null)
            {
                ProcessTest(option.Test);
            }

            return(true);
        }
Example #2
0
        static bool Redirect(string[] arguments, string contents)
        {
            DCInsideConsoleOption option = CommandLineParser <DCInsideConsoleOption> .Parse(arguments, contents != "", contents);

            if (option.Error)
            {
                Console.Instance.WriteLine(option.ErrorMessage);
                if (option.HelpMessage != null)
                {
                    Console.Instance.WriteLine(option.HelpMessage);
                }
                return(false);
            }
            else if (option.Help)
            {
                PrintHelp();
            }
            else if (option.Test != null)
            {
                ProcessTest(option.Test);
            }

            return(true);
        }