timewarrior/doc/man1/timew-export.1.adoc
Scott Mcdermott bf26176243 Allow specification of intervals to the export command
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>
2022-12-28 22:13:35 +01:00

17 lines
445 B
Text

= timew-export(1)
== NAME
timew-export - export tracked time in JSON
== SYNOPSIS
[verse]
*timew export* [_<id>_**...**] | [[_<range>_] [_<tag>_**...**]]
== DESCRIPTION
Exports all the tracked time in JSON format. Supply either a list of interval IDs (e.g. `@1 @2`), or optional filters (see **timew-ranges(7)** and/or **timew-tags(1)**)
== EXAMPLES
For example:
$ timew export from 2016-01-01 for 3wks tag1
$ timew export @1 @3 @7