mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdTags: Refactored data I/O
This commit is contained in:
parent
96d49069a2
commit
762dda43ca
1 changed files with 6 additions and 1 deletions
|
@ -37,10 +37,15 @@ int CmdTags (Rules& rules, Database& database)
|
||||||
{
|
{
|
||||||
// Generate a unique, ordered list of tags.
|
// Generate a unique, ordered list of tags.
|
||||||
std::vector <std::string> tags;
|
std::vector <std::string> tags;
|
||||||
for (auto& interval : database.getAllIntervals ())
|
for (auto& line : database.allLines ())
|
||||||
|
{
|
||||||
|
Interval interval;
|
||||||
|
interval.initialize (line);
|
||||||
|
|
||||||
for (auto& tag : interval.tags ())
|
for (auto& tag : interval.tags ())
|
||||||
if (std::find (tags.begin (), tags.end (), tag) == tags.end ())
|
if (std::find (tags.begin (), tags.end (), tag) == tags.end ())
|
||||||
tags.push_back (tag);
|
tags.push_back (tag);
|
||||||
|
}
|
||||||
|
|
||||||
// Shows all tags.
|
// Shows all tags.
|
||||||
Table t;
|
Table t;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue