From 7d4256587393ca6714368f54091cbc7f4deddd61 Mon Sep 17 00:00:00 2001 From: "Taylor C. Richberger" Date: Thu, 7 Jul 2016 16:33:37 -0600 Subject: switch pages to a submodule --- .gitmodules | 4 ++++ Makefile | 3 ++- args.hxx | 18 ++++++------------ pages | 1 + 4 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 .gitmodules create mode 160000 pages diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3386d8f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "pages"] + path = pages + url = github.com:Taywee/args.git + branch = gh-pages diff --git a/Makefile b/Makefile index 1120329..9242807 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,9 @@ clean: rm -rv $(EXECUTABLE) $(OBJECTS) $(DEPENDENCIES) doc pages: + -rm -r pages/* doxygen Doxyfile - cp -rv doc/html/* . + cp -rv doc/html/* pages/ doc/man: doxygen Doxyfile diff --git a/args.hxx b/args.hxx index 39fbdea..f2a45b9 100644 --- a/args.hxx +++ b/args.hxx @@ -585,7 +585,9 @@ namespace args std::function validator; public: + /// If help is empty, this group will not be printed in help output Group(const std::string &help = std::string(), const std::function &validator = Validators::DontCare) : Base(help), validator(validator) {} + /// If help is empty, this group will not be printed in help output Group(Group &group, const std::string &help = std::string(), const std::function &validator = Validators::DontCare) : Base(help), validator(validator) { group.Add(*this); @@ -673,7 +675,7 @@ namespace args /** Get all this group's children */ - const std::vector Children() const + const std::vector &Children() const { return children; } @@ -813,17 +815,9 @@ namespace args static bool AllChildGroups(const Group &group) { - for (const auto child: group.Children()) - { - if (const auto group = dynamic_cast(child)) - { - if (!group->Matched()) - { - return false; - } - } - } - return true; + return std::find_if(std::begin(group.Children()), std::end(group.Children()), [](const Base* child) -> bool { + return dynamic_cast(child) && !child->Matched(); + }) == std::end(group.Children()); } static bool DontCare(const Group &group) diff --git a/pages b/pages new file mode 160000 index 0000000..7d3fe5f --- /dev/null +++ b/pages @@ -0,0 +1 @@ +Subproject commit 7d3fe5fa0a244947faf0e0307bb493f68d09d8d7 -- cgit v1.2.1