mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Extract filter so it can be injected
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
6e5236d472
commit
547bda5ef8
3 changed files with 4 additions and 3 deletions
|
@ -40,10 +40,11 @@ int CmdGet (
|
|||
std::vector <std::string> results;
|
||||
std::vector <std::string> references = cli.getDomReferences ();
|
||||
|
||||
Interval filter;
|
||||
for (auto& reference : references)
|
||||
{
|
||||
std::string value;
|
||||
if (! domGet (database, rules, reference, value))
|
||||
if (! domGet (database, filter, rules, reference, value))
|
||||
throw format ("DOM reference '{1}' is not valid.", reference);
|
||||
|
||||
results.push_back (value);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool domGet (
|
||||
Database& database,
|
||||
Interval& filter,
|
||||
const Rules& rules,
|
||||
const std::string& reference,
|
||||
std::string& value)
|
||||
|
@ -104,7 +105,6 @@ bool domGet (
|
|||
|
||||
else if (pig.skipLiteral ("tracked."))
|
||||
{
|
||||
Interval filter;
|
||||
auto tracked = getTracked (database, rules, filter);
|
||||
int count = static_cast <int> (tracked.size ());
|
||||
|
||||
|
|
|
@ -97,6 +97,6 @@ std::string joinQuotedIfNeeded(const std::string& glue, const std::set <std::str
|
|||
std::string joinQuotedIfNeeded(const std::string& glue, const std::vector <std::string>& array);
|
||||
|
||||
// dom.cpp
|
||||
bool domGet (Database&, const Rules&, const std::string&, std::string&);
|
||||
bool domGet (Database&, Interval&, const Rules&, const std::string&, std::string&);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue