change conversion from string to arithmetic

This commit is contained in:
ackimixs
2024-05-20 22:06:48 +02:00
parent 4a196a34ce
commit 7fa4fabc86
4 changed files with 62 additions and 13 deletions

View File

@@ -0,0 +1,26 @@
#include <Modelec/CLParser.h>
#include <iostream>
struct B {
std::string a;
};
int main(int argc, char* argv[]) {
CLParser parser(argc, argv);
int port = parser.getOption("port", 12);
std::cout << "Port : " << port << std::endl;
auto test = parser.getOption<unsigned long long>("long");
if (test.has_value()) {
std::cout << test.value() << std::endl;
}
else {
std::cout << "missing long argument" << std::endl;
}
return 0;
}