cxxopts
cxxopts copied to clipboard
Getting full arguments value set as string including default & implicit
Hi.
My application will have a lot of parameters, so I'd like to get the full list of arguments from cxxopts and save the set as a text file.
Is it possible to iterate all arguments with specified values including default and implicit ones with cxxopts?
ParseResult::arguments() enables to get an argument list as std::vector<KeyValue>, but it doesn't contain default values.
And ParseResult has unordered_map-like overloads but it cannot be used for iteration.
auto result = options.parse(argc, argv);
// You can't do this
for (auto && argument : result)
{
std::cout << argument.first << "=" << argument.second.as<std::string>() << std::endl;
}
I can work on adding something like that to the interface.