From a2dae3379d7a47899ec3d05b2e73125fe4ec471c Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Fri, 28 Jun 2019 15:34:09 +0300 Subject: [PATCH] Ensure --export implies --editor Fixes #30149 (cherry picked from commit 9ebc146383e562cab8ac15ec5b97d7689bebe1a7) --- main/main.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 56ac5403986..fd72dbac42c 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -537,6 +537,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph auto_build_solutions = true; editor = true; + } else if (I->get() == "--export" || I->get() == "--export-debug") { // Export project + + editor = true; + main_args.push_back(I->get()); #endif } else if (I->get() == "--no-window") { // disable window creation, Windows only @@ -1286,20 +1290,10 @@ bool Main::start() { removal_docs.push_back(args[j]); } else if (args[i] == "--export") { editor = true; //needs editor - if (i + 1 < args.size()) { - _export_preset = args[i + 1]; - } else { - ERR_PRINT("Export preset name not specified"); - return false; - } + _export_preset = args[i + 1]; } else if (args[i] == "--export-debug") { editor = true; //needs editor - if (i + 1 < args.size()) { - _export_preset = args[i + 1]; - } else { - ERR_PRINT("Export preset name not specified"); - return false; - } + _export_preset = args[i + 1]; export_debug = true; #endif } else {