mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-30 11:27:19 +02:00
CLI
- Properly combines _id_ranges and _uuid_list from multiple arguments. - Properly inserts an 'or' OP between the id and uuid sections. - Removed mistaken OP tag from 'id' and 'uuid' attributes.
This commit is contained in:
parent
08634a8bb5
commit
861743c37d
1 changed files with 12 additions and 3 deletions
15
src/CLI.cpp
15
src/CLI.cpp
|
@ -1131,8 +1131,12 @@ void CLI::findUUIDs ()
|
||||||
|
|
||||||
if (n.depleted ())
|
if (n.depleted ())
|
||||||
{
|
{
|
||||||
_uuid_list = uuidList;
|
|
||||||
a->tag ("UUID");
|
a->tag ("UUID");
|
||||||
|
|
||||||
|
// Save the list.
|
||||||
|
std::vector <std::string>::iterator u;
|
||||||
|
for (u = uuidList.begin (); u != uuidList.end (); ++u)
|
||||||
|
_uuid_list.push_back (*u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1173,6 +1177,7 @@ void CLI::insertIDExpr ()
|
||||||
// or ( uuid = $UUID )
|
// or ( uuid = $UUID )
|
||||||
// )
|
// )
|
||||||
|
|
||||||
|
// Building block operators.
|
||||||
A openParen ("argSeq", "("); openParen.tag ("FILTER"); openParen.tag ("OP");
|
A openParen ("argSeq", "("); openParen.tag ("FILTER"); openParen.tag ("OP");
|
||||||
A closeParen ("argSeq", ")"); closeParen.tag ("FILTER"); closeParen.tag ("OP");
|
A closeParen ("argSeq", ")"); closeParen.tag ("FILTER"); closeParen.tag ("OP");
|
||||||
A opOr ("argSeq", "or"); opOr.tag ("FILTER"); opOr.tag ("OP");
|
A opOr ("argSeq", "or"); opOr.tag ("FILTER"); opOr.tag ("OP");
|
||||||
|
@ -1182,15 +1187,14 @@ void CLI::insertIDExpr ()
|
||||||
A opGTE ("argSeq", ">="); opGTE.tag ("FILTER"); opGTE.tag ("OP");
|
A opGTE ("argSeq", ">="); opGTE.tag ("FILTER"); opGTE.tag ("OP");
|
||||||
A opLTE ("argSeq", "<="); opLTE.tag ("FILTER"); opLTE.tag ("OP");
|
A opLTE ("argSeq", "<="); opLTE.tag ("FILTER"); opLTE.tag ("OP");
|
||||||
|
|
||||||
|
// Building block attributes.
|
||||||
A argID ("argSeq", "id");
|
A argID ("argSeq", "id");
|
||||||
argID.tag ("FILTER");
|
argID.tag ("FILTER");
|
||||||
argID.tag ("ATTRIBUTE");
|
argID.tag ("ATTRIBUTE");
|
||||||
argID.tag ("OP");
|
|
||||||
|
|
||||||
A argUUID ("argSeq", "uuid");
|
A argUUID ("argSeq", "uuid");
|
||||||
argUUID.tag ("FILTER");
|
argUUID.tag ("FILTER");
|
||||||
argUUID.tag ("ATTRIBUTE");
|
argUUID.tag ("ATTRIBUTE");
|
||||||
argUUID.tag ("OP");
|
|
||||||
|
|
||||||
reconstructed.push_back (openParen);
|
reconstructed.push_back (openParen);
|
||||||
|
|
||||||
|
@ -1241,6 +1245,11 @@ void CLI::insertIDExpr ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Combine the ID and UUID sections wiþh 'or'.
|
||||||
|
if (_id_ranges.size () &&
|
||||||
|
_uuid_list.size ())
|
||||||
|
reconstructed.push_back (opOr);
|
||||||
|
|
||||||
// Add all UUID list items.
|
// Add all UUID list items.
|
||||||
std::vector <std::string>::iterator u;
|
std::vector <std::string>::iterator u;
|
||||||
for (u = _uuid_list.begin (); u != _uuid_list.end (); ++u)
|
for (u = _uuid_list.begin (); u != _uuid_list.end (); ++u)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue