mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Enhanced Stats Report
- now reports number of unique tags (given filtering) - now reports number of unique projects (given filtering)
This commit is contained in:
parent
7c87bbc19a
commit
64cfc26ff3
1 changed files with 12 additions and 0 deletions
|
@ -1699,6 +1699,8 @@ std::string handleReportStats (TDB& tdb, T& task, Config& conf)
|
|||
int recurringT = 0;
|
||||
float daysPending = 0.0;
|
||||
int descLength = 0;
|
||||
std::map <std::string, int> allTags;
|
||||
std::map <std::string, int> allProjects;
|
||||
|
||||
std::vector <T>::iterator it;
|
||||
for (it = tasks.begin (); it != tasks.end (); ++it)
|
||||
|
@ -1727,6 +1729,13 @@ std::string handleReportStats (TDB& tdb, T& task, Config& conf)
|
|||
std::vector <std::string> tags;
|
||||
it->getTags (tags);
|
||||
if (tags.size ()) ++taggedT;
|
||||
|
||||
foreach (t, tags)
|
||||
allTags[*t] = 0;
|
||||
|
||||
std::string project = it->getAttribute ("project");
|
||||
if (project != "")
|
||||
allProjects[project] = 0;
|
||||
}
|
||||
|
||||
out << "Pending " << pendingT << std::endl
|
||||
|
@ -1764,6 +1773,9 @@ std::string handleReportStats (TDB& tdb, T& task, Config& conf)
|
|||
out << "Tasks tagged " << std::setprecision (3) << (100.0 * taggedT / totalT) << "%" << std::endl;
|
||||
}
|
||||
|
||||
out << "Unique tags " << allTags.size () << std::endl;
|
||||
out << "Projects " << allProjects.size () << std::endl;
|
||||
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue