mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Filter
- Rewrote ::pendingOnly to work with CLI instead of Parser.
This commit is contained in:
parent
e0fac11eed
commit
b7efb753b5
1 changed files with 9 additions and 8 deletions
|
@ -224,16 +224,17 @@ bool Filter::pendingOnly ()
|
||||||
int countId = 0;
|
int countId = 0;
|
||||||
int countOr = 0;
|
int countOr = 0;
|
||||||
int countXor = 0;
|
int countXor = 0;
|
||||||
std::vector <Tree*>::iterator i;
|
|
||||||
for (i = tree->_branches.begin (); i != tree->_branches.end (); ++i)
|
std::vector <A>::iterator a;
|
||||||
|
for (a = context.cli._args.begin (); a != context.cli._args.end (); ++a)
|
||||||
{
|
{
|
||||||
if ((*i)->hasTag ("FILTER"))
|
if (a->hasTag ("FILTER"))
|
||||||
{
|
{
|
||||||
if ((*i)->hasTag ("ID")) ++countId;
|
if (a->hasTag ("ID")) ++countId;
|
||||||
if ((*i)->hasTag ("OP") && (*i)->attribute ("raw") == "or") ++countOr;
|
if (a->hasTag ("OP") && a->attribute ("raw") == "or") ++countOr;
|
||||||
if ((*i)->hasTag ("OP") && (*i)->attribute ("raw") == "xor") ++countXor;
|
if (a->hasTag ("OP") && a->attribute ("raw") == "xor") ++countXor;
|
||||||
if ((*i)->hasTag ("ATTRIBUTE") && (*i)->attribute ("name") == "status") ++countStatus;
|
if (a->hasTag ("ATTRIBUTE") && a->attribute ("name") == "status") ++countStatus;
|
||||||
if ((*i)->hasTag ("ATTRIBUTE") && (*i)->attribute ("raw") == "pending") ++countPending;
|
if ( a->attribute ("raw") == "pending") ++countPending;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue