TU-Programmieren_2/lab3/modules/iue-po/po.test.cpp
2025-04-09 10:22:44 +02:00

24 lines
629 B
C++

#include "iue-po/po.hpp"
#include <cassert> // assert
#include <iostream> // std::cout|endl
int main(int argc, char* argv[]) {
auto args = iue::po::init(argc, argv);
auto value1 = iue::po::get(args, "option1", 1, iue::po::option::required);
auto value2 = iue::po::get(args, "option2", std::string("default2"), iue::po::option::required);
auto value3 = iue::po::get(args, "option3", std::string("default3"));
std::cout << value1 << std::endl;
std::cout << value2 << std::endl;
std::cout << value3 << std::endl;
assert(value1 == 100);
assert(value2 == "o2");
assert(value3 == "default3");
return 0;
}