aboutsummaryrefslogtreecommitdiff
path: root/args.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'args.hxx')
-rw-r--r--args.hxx55
1 files changed, 55 insertions, 0 deletions
diff --git a/args.hxx b/args.hxx
index 1eb8da8..bbc521d 100644
--- a/args.hxx
+++ b/args.hxx
@@ -3506,6 +3506,17 @@ namespace args
FlagBase::Reset();
values = defaultValues;
}
+
+ virtual FlagBase *Match(const EitherFlag &arg) override
+ {
+ const bool wasMatched = Matched();
+ auto me = FlagBase::Match(arg);
+ if (me && !wasMatched)
+ {
+ values.clear();
+ }
+ return me;
+ }
};
/** An argument-accepting flag class that pushes the found values into a list
@@ -3583,6 +3594,17 @@ namespace args
values = defaultValues;
}
+ virtual FlagBase *Match(const EitherFlag &arg) override
+ {
+ const bool wasMatched = Matched();
+ auto me = FlagBase::Match(arg);
+ if (me && !wasMatched)
+ {
+ values.clear();
+ }
+ return me;
+ }
+
iterator begin() noexcept
{
return values.begin();
@@ -3799,6 +3821,17 @@ namespace args
values = defaultValues;
}
+ virtual FlagBase *Match(const EitherFlag &arg) override
+ {
+ const bool wasMatched = Matched();
+ auto me = FlagBase::Match(arg);
+ if (me && !wasMatched)
+ {
+ values.clear();
+ }
+ return me;
+ }
+
iterator begin() noexcept
{
return values.begin();
@@ -3960,6 +3993,17 @@ namespace args
values = defaultValues;
}
+ virtual PositionalBase *GetNextPositional() override
+ {
+ const bool wasMatched = Matched();
+ auto me = PositionalBase::GetNextPositional();
+ if (me && !wasMatched)
+ {
+ values.clear();
+ }
+ return me;
+ }
+
iterator begin() noexcept
{
return values.begin();
@@ -4170,6 +4214,17 @@ namespace args
values = defaultValues;
}
+ virtual PositionalBase *GetNextPositional() override
+ {
+ const bool wasMatched = Matched();
+ auto me = PositionalBase::GetNextPositional();
+ if (me && !wasMatched)
+ {
+ values.clear();
+ }
+ return me;
+ }
+
iterator begin() noexcept
{
return values.begin();