mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdReport: Added filter info to the report API
This commit is contained in:
parent
869567d621
commit
6f57261517
1 changed files with 11 additions and 3 deletions
|
@ -84,9 +84,17 @@ int CmdReport (
|
|||
auto intervals = timeline.tracked (rules);
|
||||
|
||||
// Compose Header info.
|
||||
// TODO Filter.
|
||||
// TODO CLI.
|
||||
// TODO Directory containing *.data files.
|
||||
rules.set ("temp.report.start", filter.start ().toEpoch () > 0 ? filter.start ().toISO () : "");
|
||||
rules.set ("temp.report.end", filter.end ().toEpoch () > 0 ? filter.end ().toISO () : "");
|
||||
std::string combinedTags;
|
||||
for (auto& tag : filter.tags ())
|
||||
{
|
||||
if (combinedTags != "")
|
||||
combinedTags += ",";
|
||||
combinedTags += quoteIfNeeded (tag);
|
||||
}
|
||||
rules.set ("temp.report.tags", combinedTags);
|
||||
|
||||
std::stringstream header;
|
||||
for (auto& name : rules.all ())
|
||||
header << name << "=" << rules.get (name) << "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue