From 3c5623c5d48c4c3486d16a7a7fe5c7c0d3c30ad2 Mon Sep 17 00:00:00 2001 From: Nicolas Mellado Date: Mon, 8 Jan 2024 17:08:46 +0100 Subject: [PATCH] Add file loading: GUI is started if output file is not set --- src/cli.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli.cpp b/src/cli.cpp index ae26812..4b66b76 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -36,13 +36,19 @@ PoncaPlotCLI::run(int argc, char **argv) { .required() .help("input file (.pts or .txt)"); program.add_argument("-o", "--output") - .required() .help("output file (image)"); program.add_argument("-f", "--fitType") .help("fit type: [" + namesStr + "]"); try { program.parse_args(argc, argv); + auto inputPath = program.get("-i"); + if (! inputPath.empty()) + { + m_dataMgr->loadPointCloud(inputPath); + // load other properties + if( ! program.is_used("-o")) return false; // be sure that GUI is started. + } } catch (const std::exception& err) { std::cout << err.what() << std::endl;