From f0f465b20f211048dd1c08293bde3de14dc1e4f4 Mon Sep 17 00:00:00 2001 From: Jarryd Beck Date: Tue, 3 May 2022 06:21:12 +1000 Subject: [PATCH] Add unmatched arguments to example --- src/example.cpp | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/src/example.cpp b/src/example.cpp index 420220e..b06d806 100644 --- a/src/example.cpp +++ b/src/example.cpp @@ -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) { -- libgit2 0.21.4