Open chmanie opened 9 years ago
Yeah, refactoring the different output formats is definitely a good thing to work on. I suggest the following interface:
clocker list
: same as todayclocker list --aggregate day
: aggregate by dayclocker list --aggregate month
: aggregate by month (and maybe other times)clocker list --csv
: same as clocker csv
todayclocker list --json --aggrate day
: similar to clocker data
todayclocker list
.What do you think?
@fnogatz lgtm!
RFC @substack
I am working on some pinning tests to support the refactoring. I could share them with you soon.
Thanks for working on some tests at chmanie/clocker, @chmanie! My favorite approach would be:
/lib
, so one could also require('clocker').stop()
etc.
https://github.com/substack/clocker/pull/22 added csv output, which is great! additionally we have the
data
option which outputs json, but this is squashed to days to be compatible with invoicer.I'd like to have the verbose list / csv output formatted as json.
To simplify the api I'd propose a flag for the
list
command either like thisclocker list --output=json / --output=csv
, (or--json
/--csv
) because right now thecsv
command basically just reformats thelist
output. Maybe we could alias thecsv
command to not break the api?I'd also happily start working on a PR for that. Let me know what you think.