Exemplo n.º 1
0
        public static int Main(string[] args)
        {
            try
            {
                ArgHash = GetArguments(args);

                //ProjectDir = @"D:\projects\Sharpkit\SharpkitTest";
                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 (ArgHash.ContainsKey("wait"))
                {
                    Console.WriteLine("Press any key to continue...");
                    Console.ReadKey();
                }
                if (ErrorCount == 0)
                {
                    return(-1);
                }
                return(ErrorCount);
            }
        }
Exemplo n.º 2
0
        private 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);
        }