MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / process

Method process

app/src/Misc/CLI.cpp:205–247  ·  view source on GitHub ↗

* @brief Parses the command line and runs early-exit flows (version/reset/license). */

Source from the content-addressed store, hash-verified

203 * @brief Parses the command line and runs early-exit flows (version/reset/license).
204 */
205CLI::ProcessResult CLI::process(QApplication& app)
206{
207 m_parser.process(app);
208
209 if (m_parser.isSet(m_opts.versionOpt)) {
210 qDebug() << APP_NAME << "version" << APP_VERSION;
211 qDebug() << "Written by Alex Spataru <https://github.com/alex-spataru>";
212 return ProcessResult::ExitSuccess;
213 }
214
215 if (m_parser.isSet(m_opts.resetOpt)) {
216 QSettings(APP_SUPPORT_URL, APP_NAME).clear();
217 qDebug() << APP_NAME << "settings cleared!";
218 return ProcessResult::ExitSuccess;
219 }
220
221 if (m_parser.isSet(m_opts.benchmarkHotpathOpt) || m_parser.isSet(m_opts.benchmarkFramesOpt)
222 || m_parser.isSet(m_opts.benchmarkSecondsOpt) || m_parser.isSet(m_opts.minFpsOpt))
223 return runHotpathBenchmark();
224
225 if (m_parser.isSet(m_opts.dumpApiSchemaOpt))
226 return dumpApiSchema(m_parser.value(m_opts.dumpApiSchemaOpt));
227
228#ifdef BUILD_COMMERCIAL
229 if (m_parser.isSet(m_opts.selftestOfflineOpt)) {
230 return Licensing::runOfflineSelfTest() == 0 ? ProcessResult::ExitSuccess
231 : ProcessResult::ExitFailure;
232 }
233
234 if (m_parser.isSet(m_opts.activateOpt)) {
235 return activateLicense(app, m_parser.value(m_opts.activateOpt)) == EXIT_SUCCESS
236 ? ProcessResult::ExitSuccess
237 : ProcessResult::ExitFailure;
238 }
239
240 if (m_parser.isSet(m_opts.deactivateOpt)) {
241 return deactivateLicense(app) == EXIT_SUCCESS ? ProcessResult::ExitSuccess
242 : ProcessResult::ExitFailure;
243 }
244#endif
245
246 return ProcessResult::Continue;
247}
248
249/**
250 * @brief Runs the frame-extraction throughput benchmark and maps the result to an exit code.

Callers 9

mainFunction · 0.45
setModeMethod · 0.45
setExecutableMethod · 0.45
setArgumentsMethod · 0.45
setWorkingDirMethod · 0.45
setPipePathMethod · 0.45
getRunningProcessesMethod · 0.45
getConfigurationMethod · 0.45

Calls 3

QSettingsClass · 0.85
clearMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected