mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Add check whether requested intervals have been found when searching by ID
- Restores behaviour which got lost when switching to the new interval filtering in 9968b9e9
- Add test for each command
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
c2e26a989e
commit
993ae85d5c
22 changed files with 329 additions and 8 deletions
|
@ -58,6 +58,27 @@ int CmdLengthen (
|
|||
auto filtering = IntervalFilterAllWithIds (ids);
|
||||
auto intervals = getTracked (database, rules, filtering);
|
||||
|
||||
if (intervals.size () != ids.size ())
|
||||
{
|
||||
for (auto& id: ids)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
for (auto& interval: intervals)
|
||||
{
|
||||
if (interval.id == id)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
throw format ("ID '@{1}' does not correspond to any tracking.", id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Lengthen intervals specified by ids
|
||||
for (auto& interval : intervals)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue