Filter: Implemnted ::hasFilter to detect command line filters

This commit is contained in:
Paul Beckingham
2015-07-25 10:01:06 -04:00
parent 99e0953489
commit 8684639f72
2 changed files with 11 additions and 0 deletions

View File

@@ -198,6 +198,16 @@ void Filter::subset (std::vector <Task>& output, bool applyContext /* = true */)
context.timer_filter.stop ();
}
////////////////////////////////////////////////////////////////////////////////
bool Filter::hasFilter ()
{
for (auto& a : context.cli2._args)
if (a.hasTag ("FILTER"))
return true;
return false;
}
////////////////////////////////////////////////////////////////////////////////
bool Filter::hasModifications ()
{

View File

@@ -42,6 +42,7 @@ public:
void subset (const std::vector <Task>&, std::vector <Task>&, bool applyContext = true);
void subset (std::vector <Task>&, bool applyContext = true);
bool hasFilter ();
bool hasModifications ();
bool pendingOnly ();
void safety ();