nikolassv / bartib

A simple timetracker for the command line. It saves a log of all tracked activities as a plaintext file and allows you to create flexible reports.
GNU General Public License v3.0
636 stars 34 forks source link

Add JSON output for select bartib commands #26

Closed MatthiasvB closed 1 year ago

MatthiasvB commented 1 year ago

For a (more or less) personal project, I added JSON output to the most essential bartib commands.

I'm not a Rust pro, so I'm very open to and thankful for suggestions for improvements.

nikolassv commented 1 year ago

Thanks again for your work and effort to implement a JSON output format for bartib! It makes me really happy to see people use bartib and help its further development it. Unfortunately, right now, I do not think it would serve the project well to merge the PR. The problem is in my opinion not with your code but with bartibs really simple architecture.

In bartib there is today no real separation between the output, the commands and the handling of data. Such a separation would be crucial if bartib should support several output formats. Of course we could implement an ad hoc solution to generate JSON output, but if we were to support other formats like csv, markdown or even html we would need more and more ad hoc solutions. This would quickly lead to some messy code.

I hope you understand that for this reason I do not feel comfortable to merge the PR right now. Unfortunately, I do not have the time at this moment to make the necessary adjustments to bartib which would make me comfortable to support different output formats. If I do find the time some day I would be very happy to implement such a feature!