aboutsummaryrefslogtreecommitdiff
path: root/args.hxx
diff options
context:
space:
mode:
authorTaylor C. Richberger <Taywee@gmx.com>2016-05-06 12:56:26 -0600
committerTaylor C. Richberger <Taywee@gmx.com>2016-05-06 12:56:26 -0600
commitbbbcaa66f7fe512fac3ed9bc8845519297109b53 (patch)
tree649236095bbd895efe41e370a0c2621967cf64fc /args.hxx
parentimprove some of the logic (diff)
downloadargs.hxx-bbbcaa66f7fe512fac3ed9bc8845519297109b53.tar.xz
add full test suite
Diffstat (limited to 'args.hxx')
-rw-r--r--args.hxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/args.hxx b/args.hxx
index 9b9f033..e172cf6 100644
--- a/args.hxx
+++ b/args.hxx
@@ -257,6 +257,11 @@ namespace args
std::get<1>(description) = help;
return description;
}
+
+ virtual void ResetMatched()
+ {
+ matched = false;
+ }
};
/** Base class for all match types that have a name
@@ -588,6 +593,14 @@ namespace args
return names;
}
+ virtual void ResetMatched() override
+ {
+ for (auto &child: children)
+ {
+ child->ResetMatched();
+ }
+ }
+
/** Default validators
*/
struct Validators
@@ -835,6 +848,8 @@ namespace args
template <typename T>
void ParseArgs(const T &args)
{
+ // Reset all Matched statuses to false, for validation. Don't reset values.
+ ResetMatched();
bool terminated = false;
// Check all arg chunks