コード例 #1
0
        public static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                WriteHowToMakeUseOfTheToolMessage();
                Environment.Exit(0);
            }

            var coreVariables = new CoreVariables(args);
            var generator     = new Generator(coreVariables);

            Stopwatch sw = new Stopwatch();

            sw.Start();

            if (coreVariables.CreateNewSite)
            {
                generator.CreateNewSite();
            }
            else if (coreVariables.NewBlogPost)
            {
                generator.CreateNewBlogPost();
            }
            else
            {
                generator.GenerateSite();
            }

            sw.Stop();
            System.Console.WriteLine($"It took {sw.ElapsedMilliseconds}ms to generate the site as a whole process.");

            Environment.Exit(1);
        }
コード例 #2
0
 public Generator(CoreVariables cv)
 {
     _cv = cv;
 }