static void Main(string[] args)
        {
            try
            {
                // read program arguments into Argument Container
                ArgumentContainer argContainer = new ArgumentContainer();
                argContainer.ReadArguments(args);

                if (argContainer.GetHelp)
                {
                    Helper.ShowHelpMessage();
                }
                else
                {
                    string _logFilename = string.Empty;

                    if (argContainer.EnableLog)
                    {
                        _logFilename = "ninja-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".log";
                    }

                    ReportProcessor reportNinja = new ReportProcessor(_logFilename)
                    {
                        ReportArguments = argContainer,
                    };

                    if (argContainer.ReportInfo)
                    {
                        var reportInfo = reportNinja.GetReportInfo();
                        reportInfo.Output(argContainer.OutputFormat, argContainer.OutputPath);
                    }
                    else
                    {
                        reportNinja.Run();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(string.Format("Exception: {0}", ex.Message));
                Console.WriteLine(string.Format("Inner Exception: {0}", ex.InnerException));
            }
        }
Exemple #2
0
        static int Main(string[] args)
        {
            try
            {
                // read program arguments into Argument Container
                ArgumentContainer argContainer = new ArgumentContainer();
                argContainer.ReadArguments(args);

                if (argContainer.GetHelp)
                {
                    Helper.ShowHelpMessage();
                }
                else
                {
                    string _logFilename = string.Empty;

                    if (argContainer.EnableLog)
                    {
                        argContainer.LogFileName = "ninja-" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".log";
                    }

                    ReportProcessor reportNinja = new ReportProcessor();
                    reportNinja.ReportArguments = argContainer;
                    reportNinja.Run();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(string.Format("Exception: {0}", ex.Message));
                Console.WriteLine(string.Format("Inner Exception: {0}", ex.InnerException));

                return(1);
            }

            return(0);
        }