0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +02:00

[test/misc] Added test for OptionList::parse_from_argv_static().

This commit is contained in:
James Yonan 2016-03-02 00:57:18 -07:00 committed by Frank Lichtenheld
parent be72abb286
commit 1fb59fb1eb

21
test/misc/parseargv.cpp Normal file
View File

@ -0,0 +1,21 @@
#include <iostream>
#include <openvpn/common/exception.hpp>
#include <openvpn/common/string.hpp>
#include <openvpn/common/options.hpp>
using namespace openvpn;
int main(int argc, char* argv[])
{
try {
const OptionList opt = OptionList::parse_from_argv_static(string::from_argv(argc, argv, true));
std::cout << opt.render(Option::RENDER_NUMBER|Option::RENDER_BRACKET);
}
catch (const std::exception& e)
{
std::cerr << "Exception: " << e.what() << std::endl;
return 1;
}
return 0;
}