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:
parent
be72abb286
commit
1fb59fb1eb
21
test/misc/parseargv.cpp
Normal file
21
test/misc/parseargv.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user