Exemple #1
0
        static void Main(string[] args)
        {
            var options = new CommandLineOptions();
            var parser = new CommandLineParser(new CommandLineParserSettings { CaseSensitive = false, IgnoreUnknownArguments = true });
            var res = parser.ParseArguments(args, options);

            if (!res)
            {
                Console.WriteLine("check your parameters and try again");
                return;
            }

            //check to see if we have a language directive for the specified type
            LanguageConfig Language = Helpers.GetLanguage(options.FileType);

            if (Language == null)
            {
                Console.WriteLine("We don't know how to handle the requested type. You can add a definition to the language.json file and try again.");
                Environment.Exit(1);
            }

            //override settings
            App.Settings.BeVerbose = options.Verbose;

            DirectoryInfo OutputDirectory = null;

            if (!string.IsNullOrWhiteSpace(options.OutputFolder))
            {

                if (Path.IsPathRooted(options.OutputFolder))
                    OutputDirectory = new DirectoryInfo(options.OutputFolder);
                else
                    OutputDirectory = new DirectoryInfo(Path.Combine(options.Path, options.OutputFolder));
            }
            else
            {
                OutputDirectory = new DirectoryInfo(Path.Combine(options.Path, App.Settings.DefaultDocsFolderName));
            }

            //get a new job
            NoccoJob Job = new NoccoJob(new DirectoryInfo(options.Path), Language, options.FileType, OutputDirectory)
            {
                ProjectName = options.ProjectName,
                IndexFilename = !string.IsNullOrWhiteSpace(options.IndexFilename) ? options.IndexFilename : App.Settings.DefaultIndexFileName,
                GenerateInlineIndex = options.GenerateInlineIndex,
                GenerateIndexFile = options.GenerateFullIndex,
                TruncateOutputDirectory = options.Truncate
            };

            //begin processing
            Nocco.ProcessJob(Job);

            Helpers.LogMessages("Finished processing");

            Environment.Exit(0);
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            _options = new CommandLineOptions();

            if (CommandLine.Parser.Default.ParseArguments(args, _options))
            {
                Generate();
            }
        }