diff --git a/src/commands/CmdStop.cpp b/src/commands/CmdStop.cpp index 799ac0e7..52e85c15 100644 --- a/src/commands/CmdStop.cpp +++ b/src/commands/CmdStop.cpp @@ -24,12 +24,9 @@ // //////////////////////////////////////////////////////////////////////////////// -#include #include #include #include -#include -#include #include template T setIntersect ( @@ -69,12 +66,21 @@ int CmdStop ( modified.range.end = filter.range.start; } else + { modified.range.end = Datetime (); + } // Close the interval. database.deleteInterval (latest); validate (cli, rules, database, modified); - database.addInterval (modified); + + for (auto& interval : flatten (modified, getAllExclusions (rules, modified.range))) + { + database.addInterval (interval); + + if (rules.getBoolean ("verbose")) + std::cout << intervalSummarize (database, rules, interval); + } // If tags are specified, but are not a full set of tags, remove them // before closing the interval.