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 <cmake.h>
|
||||||
#include <commands.h>
|
#include <commands.h>
|
||||||
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int CmdTags (Database& database, Log& log)
|
int CmdTags (Database& database, Log& log)
|
||||||
{
|
{
|
||||||
std::cout << "[tags: enumerate tags in use]\n";
|
// Generate a unique, ordered list of tags.
|
||||||
|
std::vector <std::string> tags;
|
||||||
// TODO Enumerate all data files.
|
for (auto& interval : database.getAllIntervals ())
|
||||||
// TODO For each data file.
|
for (auto& tag : interval.tags ())
|
||||||
// TODO For each inclusion.
|
if (std::find (tags.begin (), tags.end (), tag) == tags.end ())
|
||||||
// TODO Extract tags.
|
tags.push_back (tag);
|
||||||
// TODO Add tags to unique set.
|
|
||||||
|
|
||||||
// TODO Determine sort order - most recent first?
|
// TODO Determine sort order - most recent first?
|
||||||
// TODO Determine sort order - most common first?
|
// TODO Determine sort order - most common first?
|
||||||
|
|
||||||
// TODO For each tag in set.
|
// Shows all tags.
|
||||||
// TODO Load metadata.
|
// TODO Show all tag metadata.
|
||||||
// TODO Display.
|
for (auto& tag : tags)
|
||||||
|
std::cout << tag << "\n";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue