Beispiel #1
0
        static void Main(string[] args)
        {
            MarkdownGenerator markdownGenerator = new MarkdownGenerator();
            SharedContent     sharedContent     = new SharedContent();

            JsonRpcGenerator rpcGenerator = new JsonRpcGenerator(markdownGenerator, sharedContent);

            rpcGenerator.Generate();

            CliGenerator cliGenerator = new CliGenerator(markdownGenerator, sharedContent);

            cliGenerator.Generate();

            MetricsGenerator metricsGenerator = new MetricsGenerator(sharedContent);

            metricsGenerator.Generate();

            ConfigGenerator configGenerator = new ConfigGenerator(sharedContent);

            configGenerator.Generate();
        }
Beispiel #2
0
        public static void Generate(
            CliDefinitionList cliDefinition,
            string outputPath,
            bool overwriteFiles,
            bool verbose,
            IConsoleWriter console)
        {
            ParsedDefinitionList parsedDefinitionSet;

            try
            {
                parsedDefinitionSet = ParsedDefinitionList.Parse(cliDefinition, console);
            }
            catch (Exception exc)
            {
                console.WriteError($"ERROR: Could not parse the definition.");
                console.WriteError(exc.Message);
                return;
            }

            try
            {
                var generator = new CliGenerator();
                generator.Generate(parsedDefinitionSet,
                                   new GeneratorSettings()
                {
                    OverwriteFiles = overwriteFiles,
                    Verbose        = verbose,
                    OutputPath     = outputPath
                },
                                   console);
            }
            catch (Exception exc)
            {
                console.WriteError($"ERROR: Could not generate command line classes.");
                console.WriteError(exc.Message);
                return;
            }
        }