Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            string monoPath = null;
            string optName  = null;

            var argIndex = 0;

            while (argIndex < args.Length)
            {
                if (args [argIndex] == "--mono")
                {
                    monoPath  = args [argIndex + 1];
                    argIndex += 2;
                }
                else if (args [argIndex] == "--opt")
                {
                    optName   = args [argIndex + 1];
                    argIndex += 2;
                }
                else if (args [argIndex] == "--help")
                {
                    UsageAndExit(0);
                }
                else if (args [argIndex] == "--")
                {
                    argIndex += 1;
                    break;
                }
                else
                {
                    UsageAndExit(1);
                }
            }

            if (monoPath == null || optName == null || argIndex == args.Length)
            {
                UsageAndExit(1);
            }

            var bisectInfo = new BisectInfo {
                MonoPath = monoPath,
                OptName  = optName,
                Args     = args.Skip(argIndex)
            };
            var success = bisectInfo.Bisect();

            Environment.Exit(success ? 0 : 1);
        }
Ejemplo n.º 2
0
		public static void Main (string[] args)
		{
			string monoPath = null;
			string optName = null;

			var argIndex = 0;
			while (argIndex < args.Length) {
				if (args [argIndex] == "--mono") {
					monoPath = args [argIndex + 1];
					argIndex += 2;
				} else if (args [argIndex] == "--opt") {
					optName = args [argIndex + 1];
					argIndex += 2;
				} else if (args [argIndex] == "--help") {
					UsageAndExit (0);
				} else if (args [argIndex] == "--") {
					argIndex += 1;
					break;
				} else {
					UsageAndExit (1);
				}
			}

			if (monoPath == null || optName == null || argIndex == args.Length)
				UsageAndExit (1);

			var bisectInfo = new BisectInfo {
				MonoPath = monoPath,
				OptName = optName,
				Args = args.Skip (argIndex)
			};
			var success = bisectInfo.Bisect ();
			Environment.Exit (success ? 0 : 1);
		}