mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
validate: Renamed validateInterval to vaildate, and integrated
This commit is contained in:
parent
123655079c
commit
f66127f473
17 changed files with 135 additions and 48 deletions
|
@ -411,34 +411,3 @@ std::string minimalDelta (const Datetime& left, const Datetime& right)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void validateInterval (
|
||||
Database& database,
|
||||
const Rules& rules,
|
||||
const Interval& interval)
|
||||
{
|
||||
// TODO Need to verify that interval.tags do not overlap with stored data.
|
||||
// Unless the tags that overlap are allowed to overlap.
|
||||
|
||||
// Warn on new tag.
|
||||
if (rules.getBoolean ("verbose"))
|
||||
{
|
||||
std::set <std::string> tags;
|
||||
for (auto& line : database.allLines ())
|
||||
{
|
||||
if (line[0] == 'i')
|
||||
{
|
||||
Interval interval;
|
||||
interval.initialize (line);
|
||||
|
||||
for (auto& tag : interval.tags ())
|
||||
tags.insert (tag);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& tag : interval.tags ())
|
||||
if (tags.find (tag) == tags.end ())
|
||||
std::cout << "Note: '" << tag << "' is a new tag.\n";
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue