parser example

This commit is contained in:
ackimixs
2024-05-23 16:17:59 +02:00
parent 90e7ed973f
commit 4b7b12f1e8

View File

@@ -11,16 +11,7 @@ int main(int argc, char* 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;
}
auto test = parser.getOption("host", "127.0.0.1");
return 0;
}