Exemplo n.º 1
0
        public static string GetUsageString()
        {
            var definition = new ArgumentDefinition(typeof(CommandLineArguments));
            var parser     = new GNUArgumentParser();

            return($"Usage: {parser.GenerateUsageString(definition)}");
        }
Exemplo n.º 2
0
        public static int Main(string[] Args)
        {
            var definition = new ArgumentDefinition(new HtmlReportArguments().GetType());
            var parser     = new GNUArgumentParser();

            int exitCode = 0;

            try
            {
                var arguments = parser.Parse <HtmlReportArguments>(definition, Args);

                string cssCode = ReadAllText(arguments.CssPath);
                var    reports = new List <TestReport>();
                foreach (var reportPath in arguments.ReportPaths)
                {
                    reports.Add(ParseReport(reportPath));
                }
                var htmlDoc = CreateComparisonHtml(cssCode, reports);
                htmlDoc.Save(Console.Out);
                Console.WriteLine();
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("error: {0}", ex.Message);
                Console.Error.Write("usage: {0}", parser.GenerateUsageString(definition));

                exitCode = 1;
            }
            return(exitCode);
        }