mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 11:27:19 +02:00
- Beginnings of the "task list pri:!H" inverse filtering capability.
Doesn't work, and is commented out for now. Need a better approach because of the priority attribute validation of "!H" failing, and the Unix shell interpreting "!", thus requiring an escape, which makes the command ("task list pri:\!H") ugly.
This commit is contained in:
parent
ecdfb31553
commit
28ceeac796
1 changed files with 31 additions and 0 deletions
|
@ -86,9 +86,40 @@ void filter (std::vector<T>& all, T& task)
|
||||||
if (a->second.length () <= refTask.getAttribute (a->first).length ())
|
if (a->second.length () <= refTask.getAttribute (a->first).length ())
|
||||||
if (a->second == refTask.getAttribute (a->first).substr (0, a->second.length ()))
|
if (a->second == refTask.getAttribute (a->first).substr (0, a->second.length ()))
|
||||||
++matches;
|
++matches;
|
||||||
|
/*
|
||||||
|
TODO Attempt at allowing "pri:!H", thwarted by a lack of coffee and the
|
||||||
|
validation of "!H" as a priority value. To be revisited soon.
|
||||||
|
{
|
||||||
|
if (a->second[0] == '!') // Inverted search.
|
||||||
|
{
|
||||||
|
if (a->second.substr (1, std::string::npos) != refTask.getAttribute (a->first).substr (0, a->second.length ()))
|
||||||
|
++matches;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (a->second == refTask.getAttribute (a->first).substr (0, a->second.length ()))
|
||||||
|
++matches;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else if (a->second == refTask.getAttribute (a->first))
|
else if (a->second == refTask.getAttribute (a->first))
|
||||||
++matches;
|
++matches;
|
||||||
|
/*
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (a->second[0] == '!') // Inverted search.
|
||||||
|
{
|
||||||
|
if (a->second.substr (1, std::string::npos) != refTask.getAttribute (a->first))
|
||||||
|
++matches;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (a->second == refTask.getAttribute (a->first))
|
||||||
|
++matches;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matches == attrList.size ())
|
if (matches == attrList.size ())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue