static ArgumentDictionary GetArguments(string[] args) { var dic = new ArgumentDictionary(); foreach (var arg in args) { var idx = arg.IndexOf(":"); if (idx == -1) { dic.Add(arg.Substring(1), null); } else { dic.Add(arg.Substring(1, idx - 1), arg.Substring(1 + idx)); } } return(dic); }
public static int Main(string[] args) { try { ArgHash = GetArguments(args); //ProjectDir = @"C:\Users\sebastian.sharpkit\Documents\Visual Studio 2010\Projects\tests\CoreTests"; ProjectDir = Environment.CurrentDirectory; if (ArgHash.GetValue("compile", "1") == "1") //--> /compile:0 for skip compiling { Compile(); } if (ArgHash.GetValue("compare", "1") == "1") //--> /compare:0 for skip comparing { Compare(); } return(0); } catch (Exception e) { WriteLine(e.Message, ConsoleColor.Red); if (ErrorCount == 0) { return(-1); } return(ErrorCount); } finally { if (ArgHash != null && ArgHash.ContainsKey("wait")) { Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } } }