Closed adius closed 7 years ago
I don't really see the usecase for that in the export-subcommand
😳 I was really surprised that it only exported the open tasks.
If I export data from a program I expect it to export all data it has.
So I actually I would per default export the open and the completed tasks
and add --open
and --completed
flags if one wants to only export a subset.
If you export your emails from your email app you don't expect it to only export your unread emails either, would you? ^^
So I actually I would per default export the open and the completed tasks and add --open and --completed flags if one wants to only export a subset.
Yeah, that sounds like the right way to do it, feel free to open another PR for the additional flag and changing the default output (or include it into this one). Therefore I will merge your PR once you fix the two things mentioned in my review.
Is there anything I can help you with to get this PR ready for merge @adius ?
Not sure if this is the most beautiful solution, but the limited Wunderlist API doesn't make things easy…
Thanks for taking a look again and implementing the additional flag right away. I'm not sure about changing the default, though. What do you think, @wayneashleyberry ?
From my side I'd leave these filters out of the export
command. Export was only ever intended to give you all of your data, what you then choose to do with it is up to you.
There are many tools available such as jid and jq which provide excellent filtering for json.
Here is an example of filtering only your starred tasks from a full export using jq.
wunderline export | jq '.data.lists[].tasks[] | select(.starred == true)'
Theoretically a similar filter could be applied to get completed or uncompleted tasks, but I deleted all of my completed tasks haha
wunderline export | jq '.data.lists[].tasks[] | select(.completed == true)'
Hey @adius, I'm going to close this pull request. I appreciate you pointing out that completed tasks weren't being exported, but I've opted for a simpler implementation.
Merged in https://github.com/wayneashleyberry/wunderline/pull/105 and published as v4.4.4.
Please let me know if you're happy @adius. I've also updated the readme with examples for filtering out the exported data.
Looks good, Thanks!
I don't really see the usecase for that in the export-subcommand, can you elaborate why you think this feature is useful?