Add unmatched arguments to example

Ref #242. Adds an example in the example file showing the unmatched
arguments that are stored.
This commit is contained in:
Jarryd Beck 2022-05-03 06:21:12 +10:00
parent 8185e6bb3a
commit f0f465b20f

View File

@ -173,6 +173,13 @@ parse(int argc, const char* argv[])
auto arguments = result.arguments();
std::cout << "Saw " << arguments.size() << " arguments" << std::endl;
std::cout << "Unmatched options: ";
for (const auto& option: result.unmatched())
{
std::cout << "'" << option << "' ";
}
std::cout << std::endl;
}
catch (const cxxopts::OptionException& e)
{