Ignore tools CLI flags in non-tools builds.

Some flags were still parsed but either did nothing or broke everything.

No reason to parse them.

(cherry picked from commit dd19826277)
This commit is contained in:
Pieter-Jan Briers 2018-02-16 19:40:22 +01:00 committed by Hein-Pieter van Braam
parent 3687faa78f
commit e9d8dfbf0e
1 changed files with 11 additions and 5 deletions

View File

@ -517,6 +517,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
//video_mode.fullscreen=false; //video_mode.fullscreen=false;
init_fullscreen = true; init_fullscreen = true;
#ifdef TOOLS_ENABLED
} else if (I->get() == "-e" || I->get() == "--editor") { // starts editor } else if (I->get() == "-e" || I->get() == "--editor") { // starts editor
editor = true; editor = true;
@ -526,6 +527,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "--build-solutions") { // Build the scripting solution such C# } else if (I->get() == "--build-solutions") { // Build the scripting solution such C#
auto_build_solutions = true; auto_build_solutions = true;
#endif
} else if (I->get() == "--no-window") { // disable window creation, Windows only } else if (I->get() == "--no-window") { // disable window creation, Windows only
OS::get_singleton()->set_no_window_mode(true); OS::get_singleton()->set_no_window_mode(true);
@ -1229,24 +1231,27 @@ bool Main::start() {
//parameters that do not have an argument to the right //parameters that do not have an argument to the right
if (args[i] == "--no-docbase") { if (args[i] == "--no-docbase") {
doc_base = false; doc_base = false;
#ifdef TOOLS_ENABLED
} else if (args[i] == "-e" || args[i] == "--editor") { } else if (args[i] == "-e" || args[i] == "--editor") {
editor = true; editor = true;
} else if (args[i] == "-p" || args[i] == "--project-manager") { } else if (args[i] == "-p" || args[i] == "--project-manager") {
project_manager = true; project_manager = true;
#endif
} else if (args[i].length() && args[i][0] != '-' && game_path == "") { } else if (args[i].length() && args[i][0] != '-' && game_path == "") {
game_path = args[i]; game_path = args[i];
} }
//parameters that have an argument to the right //parameters that have an argument to the right
else if (i < (args.size() - 1)) { else if (i < (args.size() - 1)) {
bool parsed_pair = true; bool parsed_pair = true;
if (args[i] == "--doctool") { if (args[i] == "-s" || args[i] == "--script") {
doc_tool = args[i + 1];
for (int j = i + 2; j < args.size(); j++)
removal_docs.push_back(args[j]);
} else if (args[i] == "-s" || args[i] == "--script") {
script = args[i + 1]; script = args[i + 1];
} else if (args[i] == "--test") { } else if (args[i] == "--test") {
test = args[i + 1]; test = args[i + 1];
#ifdef TOOLS_ENABLED
} else if (args[i] == "--doctool") {
doc_tool = args[i + 1];
for (int j = i + 2; j < args.size(); j++)
removal_docs.push_back(args[j]);
} else if (args[i] == "--export") { } else if (args[i] == "--export") {
editor = true; //needs editor editor = true; //needs editor
if (i + 1 < args.size()) { if (i + 1 < args.size()) {
@ -1264,6 +1269,7 @@ bool Main::start() {
return false; return false;
} }
export_debug = true; export_debug = true;
#endif
} else { } else {
// The parameter does not match anything known, don't skip the next argument // The parameter does not match anything known, don't skip the next argument
parsed_pair = false; parsed_pair = false;