diff --git a/src/rs_t265_vio.cpp b/src/rs_t265_vio.cpp index 5b353ea..5f012b6 100644 --- a/src/rs_t265_vio.cpp +++ b/src/rs_t265_vio.cpp @@ -137,6 +137,12 @@ int main(int argc, char** argv) { app.add_option("--num-threads", num_threads, "Number of threads."); app.add_option("--step-by-step", step_by_step, "Path to config file."); + try { + app.parse(argc, argv); + } catch (const CLI::ParseError& e) { + return app.exit(e); + } + // global thread limit is in effect until global_control object is destroyed std::unique_ptr tbb_global_control; if (num_threads > 0) { @@ -144,12 +150,6 @@ int main(int argc, char** argv) { tbb::global_control::max_allowed_parallelism, num_threads); } - try { - app.parse(argc, argv); - } catch (const CLI::ParseError& e) { - return app.exit(e); - } - if (!config_path.empty()) { vio_config.load(config_path); } else { diff --git a/src/vio.cpp b/src/vio.cpp index 90bab30..e40ba1f 100644 --- a/src/vio.cpp +++ b/src/vio.cpp @@ -222,6 +222,12 @@ int main(int argc, char** argv) { "Save trajectory. Supported formats "); app.add_option("--use-imu", use_imu, "Use IMU."); + try { + app.parse(argc, argv); + } catch (const CLI::ParseError& e) { + return app.exit(e); + } + // global thread limit is in effect until global_control object is destroyed std::unique_ptr tbb_global_control; if (num_threads > 0) { @@ -229,12 +235,6 @@ int main(int argc, char** argv) { tbb::global_control::max_allowed_parallelism, num_threads); } - try { - app.parse(argc, argv); - } catch (const CLI::ParseError& e) { - return app.exit(e); - } - if (!config_path.empty()) { vio_config.load(config_path);