From 81f1f440edf05aeaf4744ee7a6658789dc425468 Mon Sep 17 00:00:00 2001 From: Jarryd Beck Date: Fri, 22 Jan 2016 17:44:00 +1100 Subject: [PATCH] count arguments --- src/example.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/example.cpp b/src/example.cpp index c85ee0a..dbe8a52 100644 --- a/src/example.cpp +++ b/src/example.cpp @@ -41,7 +41,7 @@ int main(int argc, char* argv[]) ("i,input", "Input", cxxopts::value()) ("o,output", "Output file", cxxopts::value() ->default_value("a.out")->implicit_value("b.def"), "BIN") - ("positional", + ("positional", "Positional arguments: these are the arguments that are entered " "without an option", cxxopts::value>()) ("long-description", @@ -71,7 +71,8 @@ int main(int argc, char* argv[]) if (apple) { - std::cout << "Saw option ‘a’" << std::endl; + std::cout << "Saw option ‘a’ " << options.count("a") << " times " << + std::endl; } if (options.count("b")) -- libgit2 0.21.4