mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-21 07:43:08 +02:00
CLI
- Implemented ::getFilter to extract all the non-PSEUDO, FILTER items.
This commit is contained in:
parent
8afb39dea6
commit
9f8c4e02a7
1 changed files with 16 additions and 15 deletions
31
src/CLI.cpp
31
src/CLI.cpp
|
@ -287,6 +287,7 @@ void CLI::add (const std::string& arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Extract all the FILTER-tagged items.
|
||||||
const std::string CLI::getFilter ()
|
const std::string CLI::getFilter ()
|
||||||
{
|
{
|
||||||
// Remove all the syntactic sugar.
|
// Remove all the syntactic sugar.
|
||||||
|
@ -295,28 +296,28 @@ const std::string CLI::getFilter ()
|
||||||
// TODO all the other types: att, attmod, pattern, id, uuid ...
|
// TODO all the other types: att, attmod, pattern, id, uuid ...
|
||||||
|
|
||||||
std::string filter = "";
|
std::string filter = "";
|
||||||
|
if (_args.size ())
|
||||||
// TODO Convert to _args.
|
|
||||||
/*
|
|
||||||
if (_filter.size ())
|
|
||||||
{
|
{
|
||||||
filter = "(";
|
std::vector <A>::const_iterator a;
|
||||||
|
for (a = _args.begin (); a != _args.end (); ++a)
|
||||||
std::vector <A>::const_iterator i;
|
|
||||||
for (i = _filter.begin (); i != _filter.end (); ++i)
|
|
||||||
{
|
{
|
||||||
if (i != _filter.begin ())
|
if (a->hasTag ("FILTER") &&
|
||||||
filter += ' ';
|
! a->hasTag ("PSEUDO"))
|
||||||
|
{
|
||||||
|
if (filter != "")
|
||||||
|
filter += ' ';
|
||||||
|
|
||||||
filter += i->attribute ("raw");
|
std::string term = a->attribute ("canonical");
|
||||||
|
if (term == "")
|
||||||
|
term = a->attribute ("raw");
|
||||||
|
|
||||||
|
filter += term;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filter += ')';
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
dump ("CLI::getFilter");
|
dump ("CLI::getFilter");
|
||||||
return filter;
|
return "(" + filter + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue