public static void RunPlan()
    {
        var plan = GetArg("-plan");

        if (plan == null)
        {
            throw new ArgumentException("You need to specify a -plan argument.");
        }


        UTAutomationPlan thePlan = UTomate.UTAutomationPlanByName(plan);

        if (thePlan == null)
        {
            throw new ArgumentException("There is no plan named '" + plan + "'");
        }

        var props     = GetArgs("-prop");
        var realProps = ParseProps(props);

        var debugMode = GetArg("-debugMode");

        if (debugMode == "true")
        {
            UTPreferences.DebugMode = true;
        }
        else
        {
            UTPreferences.DebugMode = false;
        }


        UTomateRunner.Instance.OnRunnerFinished += delegate(bool cancelled, bool failed) {
            EditorApplication.Exit(cancelled || failed ? 1 : 0);
        };

        UTomate.Run(thePlan, realProps);
    }