diff options
author | Taylor C. Richberger <Taywee@gmx.com> | 2016-05-06 12:56:26 -0600 |
---|---|---|
committer | Taylor C. Richberger <Taywee@gmx.com> | 2016-05-06 12:56:26 -0600 |
commit | bbbcaa66f7fe512fac3ed9bc8845519297109b53 (patch) | |
tree | 649236095bbd895efe41e370a0c2621967cf64fc /args.hxx | |
parent | improve some of the logic (diff) | |
download | args.hxx-bbbcaa66f7fe512fac3ed9bc8845519297109b53.tar.xz |
add full test suite
Diffstat (limited to 'args.hxx')
-rw-r--r-- | args.hxx | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 |