Example #1
0
        public void Get(string[] commands)
        {
            for (var index = 0; index < commands.Length - 1; index += 2)
            {
                switch (commands[index])
                {
                case "--log-dir":
                    if (!commands[index + 1].Contains("\\"))
                    {
                        Console.WriteLine("Please provide correct path");
                    }

                    LogDir = commands[index + 1];
                    break;

                case "--log-level":
                    if (!(commands[index + 1].ToLower().Equals("trace") || commands[index + 1].ToLower().Equals("info") ||
                          commands[index + 1].ToLower().Equals("warn") || commands[index + 1].ToLower().Equals("debug")))
                    {
                        Console.WriteLine("Please provode correct log level");
                    }
                    LogLevels.Add(commands[index + 1]);
                    break;

                case "--csv":
                    if (!commands[index + 1].Contains("\\"))
                    {
                        Console.WriteLine("Please provide correct path formate");
                    }

                    if (!Directory.Exists(commands[index + 1]))
                    {
                        Console.WriteLine("Please provide correct output path");
                    }

                    OutPath = commands[index + 1];
                    break;

                default:
                    Console.WriteLine("Please enter valid command");
                    return;
                }
            }
        }