mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Add DOM query dom.tracked.tags
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
5c234c95f9
commit
6e5236d472
2 changed files with 55 additions and 1 deletions
23
src/dom.cpp
23
src/dom.cpp
|
@ -108,6 +108,29 @@ bool domGet (
|
|||
auto tracked = getTracked (database, rules, filter);
|
||||
int count = static_cast <int> (tracked.size ());
|
||||
|
||||
// dom.tracked.tags
|
||||
if (pig.skipLiteral ("tags"))
|
||||
{
|
||||
std::set <std::string> tags;
|
||||
for (const auto& interval : tracked)
|
||||
{
|
||||
for (const auto &tag : interval.tags ())
|
||||
{
|
||||
tags.insert (tag);
|
||||
}
|
||||
}
|
||||
|
||||
std::stringstream s;
|
||||
|
||||
for (const auto& tag : tags)
|
||||
{
|
||||
s << format ( "{1} ", tag );
|
||||
}
|
||||
|
||||
value = s.str();
|
||||
return true;
|
||||
}
|
||||
|
||||
// dom.tracked.count
|
||||
if (pig.skipLiteral ("count"))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue