cmdopts: Now accepts 0 or more -d opts

In preparation for the deviceSpecParser.
This commit is contained in:
2025-01-05 14:04:31 -04:00
parent 0232293bb0
commit f16d3b24b3
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ public:
std::vector<std::string> extro;
std::vector<std::string> intero;
std::vector<std::string> actuator;
std::string devFile;
std::vector<std::string> deviceSpecFiles;
bool verbose, printUsage;
static struct option longOptions[];
+6 -2
View File
@@ -39,7 +39,7 @@ void OptionParser::parseArguments(int argc, char *argv[])
actuator.push_back(optarg);
break;
case 'd':
devFile = optarg;
deviceSpecFiles.push_back(optarg);
break;
case 'v':
verbose = true;
@@ -87,5 +87,9 @@ void OptionParser::dumpOptions() const
}
std::cout << std::endl;
std::cout << "Dev file: " << devFile << std::endl;
std::cout << "Device Spec Files: ";
for (const auto& file : deviceSpecFiles) {
std::cout << file << " ";
}
std::cout << std::endl;
}