aboutsummaryrefslogtreecommitdiff
path: root/args.hxx
diff options
context:
space:
mode:
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