@@ -129,10 +129,12 @@ int main(int argc, char *argv[])
129129 " , to save the generated JavaScript or Python code." )
130130 , " path-to-save-code" , QString ());
131131 QCommandLineOption generateModeOption (" generate-mode" , QObject::tr (" Select \" python\" or \" javascript\" ." )
132- , " generate-mode" , " python " );
132+ , " generate-mode" , " javascript " );
133133 QCommandLineOption directScriptExecutionPathOption (" script-path"
134134 , QObject::tr (" The path to the Python or JavaScript file that will be used for interpretation." )
135135 , " script-path" , QString ());
136+ QCommandLineOption onlyGenerateOption (" only-generate"
137+ , QObject::tr (" Do not run the interpretation in any mode, this is a parameter that is only used to generate a file." ));
136138 parser.addOption (backgroundOption);
137139 parser.addOption (reportOption);
138140 parser.addOption (trajectoryOption);
@@ -145,6 +147,7 @@ int main(int argc, char *argv[])
145147 parser.addOption (generatePathOption);
146148 parser.addOption (generateModeOption);
147149 parser.addOption (directScriptExecutionPathOption);
150+ parser.addOption (onlyGenerateOption);
148151 parser.process (*app);
149152 const QStringList positionalArgs = parser.positionalArguments ();
150153 if (positionalArgs.size () != 1 ) {
@@ -162,12 +165,14 @@ int main(int argc, char *argv[])
162165 const QString generatePath = parser.value (generatePathOption);
163166 const QString generateMode = parser.value (generateModeOption);
164167 const QString scriptFilePath = parser.value (directScriptExecutionPathOption);
168+ const bool onlyGenerate = parser.isSet (onlyGenerateOption);
165169
166170 QScopedPointer<twoDModel::Runner> runner (new twoDModel::Runner (report, trajectory, input, mode, qrsFile));
167171 auto speedFactor = parser.value (speedOption).toInt ();
168172
169173 if (!generatePath.isEmpty ()) {
170- if (generateMode != " python" and generateMode != " javascript" ) {
174+ if (generateMode != " python" and generateMode != " javascript"
175+ and generateMode != " nxt" ) {
171176 parser.showHelp ();
172177 QLOG_ERROR () << " Problem with generate code to " << generatePath;
173178 return TWO_D_MODEL_RUNNER_GENERATE_MODE_NOT_EXIST;
@@ -178,6 +183,10 @@ int main(int argc, char *argv[])
178183 }
179184 }
180185
186+ if (onlyGenerate || mode == " nxt" ) {
187+ return 0 ;
188+ }
189+
181190 if (!runner->interpret (backgroundMode, speedFactor, closeOnFinishMode,
182191 closeOnSuccessMode, showConsoleMode, scriptFilePath)) {
183192 return TWO_D_MODEL_RUNNER_INTERPRET_ERROR;
0 commit comments