mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdReport: Partial implementation
This commit is contained in:
parent
8c2ce5847f
commit
a864ae01e2
1 changed files with 30 additions and 4 deletions
|
@ -27,6 +27,7 @@
|
|||
#include <cmake.h>
|
||||
#include <commands.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdReport (
|
||||
|
@ -36,22 +37,47 @@ int CmdReport (
|
|||
Extensions& extensions,
|
||||
Log& log)
|
||||
{
|
||||
std::cout << "[report: run a specific report/extension]\n";
|
||||
// Load all data.
|
||||
auto intervals = database.getAllIntervals ();
|
||||
|
||||
// TODO Load all data.
|
||||
// TODO Apply filter.
|
||||
|
||||
// TODO Identify report.
|
||||
|
||||
// TODO Compose Header info.
|
||||
std::stringstream header;
|
||||
// TODO Configuration.
|
||||
// TODO Exclusions.
|
||||
// TODO Filter.
|
||||
// TODO CLI.
|
||||
// TODO Directory containing *.data files.
|
||||
// TODO cmake.h VERSION
|
||||
header << "version=" << VERSION << "\n";
|
||||
|
||||
// Compose JSON.
|
||||
std::stringstream json;
|
||||
json << "[\n";
|
||||
int counter = 0;
|
||||
for (auto& interval : intervals)
|
||||
{
|
||||
if (counter)
|
||||
json << ",\n";
|
||||
|
||||
json << interval.json ();
|
||||
++counter;
|
||||
}
|
||||
|
||||
if (intervals.size ())
|
||||
json << "\n";
|
||||
|
||||
json << "]\n";
|
||||
|
||||
// TODO Compose JSON.
|
||||
// TODO Run report.
|
||||
auto input = header.str ()
|
||||
+ "\n"
|
||||
+ json.str ();
|
||||
|
||||
std::vector <std::string> output;
|
||||
// extensions.callExtension (pathToScript, split (input, '\n'), output);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue