mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-27 12:16:25 +02:00
CmdTags: Implemented 'tags' command
This commit is contained in:
parent
5710800d0f
commit
3c0dc76694
1 changed files with 11 additions and 10 deletions
|
@ -26,25 +26,26 @@
|
|||
|
||||
#include <cmake.h>
|
||||
#include <commands.h>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdTags (Database& database, Log& log)
|
||||
{
|
||||
std::cout << "[tags: enumerate tags in use]\n";
|
||||
|
||||
// TODO Enumerate all data files.
|
||||
// TODO For each data file.
|
||||
// TODO For each inclusion.
|
||||
// TODO Extract tags.
|
||||
// TODO Add tags to unique set.
|
||||
// Generate a unique, ordered list of tags.
|
||||
std::vector <std::string> tags;
|
||||
for (auto& interval : database.getAllIntervals ())
|
||||
for (auto& tag : interval.tags ())
|
||||
if (std::find (tags.begin (), tags.end (), tag) == tags.end ())
|
||||
tags.push_back (tag);
|
||||
|
||||
// TODO Determine sort order - most recent first?
|
||||
// TODO Determine sort order - most common first?
|
||||
|
||||
// TODO For each tag in set.
|
||||
// TODO Load metadata.
|
||||
// TODO Display.
|
||||
// Shows all tags.
|
||||
// TODO Show all tag metadata.
|
||||
for (auto& tag : tags)
|
||||
std::cout << tag << "\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue