mirror of
https://github.com/modelec/cpp-lib.git
synced 2026-01-18 16:17:22 +01:00
26 lines
474 B
C++
26 lines
474 B
C++
#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<long>("long");
|
|
|
|
if (test.has_value()) {
|
|
std::cout << test.value() << std::endl;
|
|
}
|
|
else {
|
|
std::cout << "missing long argument" << std::endl;
|
|
}
|
|
|
|
return 0;
|
|
} |