This patch checks if intervals are given on cli to 'timew export', and
if so will filter only those numbered IDs out from the db. This lets
the user that already knows the interval(s) they want to know about, to
ask for only those, without parsing the whole thing (similar to how we
can do this for taskwarrior IDs).
If both intervals and other filters -- time range or tags -- are given,
this is considered an error. There would seem to be little use to AND
or OR tags/ranges with IDs because anyone that knew IDs to request would
already know those IDs met their requirement.
Fixes#510
Code additions from @lauft PR notes (thanks!):
- factor out 'filtering' so we can do only one call to getTracked()
- simplify (tag || range) to .empty(), which already checks both
- error message phrasing
Signed-off-by: Scott Mcdermott <scott@smemsh.net>
It is not sufficient to stop looking for matching intervals if the
interval start time is before the filter. We really want to make sure
that we pick up any intervals that intersect with the filter.
Fixes bug introduced in (a98bd14 "Simplify getIntervalsById and
getTracked") as part of #423.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>