davidchambers / tutor

JavaScript interface for the Gatherer card database
https://gatherer.wizards.com/
Do What The F*ck You Want To Public License
149 stars 18 forks source link

cli: pretty-print JSON output #67

Closed davidchambers closed 11 years ago

robdennis commented 11 years ago

Potential counterpoint: it does increase parse times and potential for buffer overflow for CLI consumers that are other applications. ​ I've always piped to python -m json.tool (I think it's in the readme) if I needed pretty print.

​ It's easy to say "make it an option" but there's obviously a cost for too many options.

Thanks, -Rob

On Mon, Jul 22, 2013 at 1:19 PM, David Chambers notifications@github.com wrote:


Reply to this email directly or view it on GitHub: https://github.com/davidchambers/tutor/issues/67

davidchambers commented 11 years ago

Good points, Rob. I certainly don't want to add another option when one can, as you say, pipe to a prettifier.

I recently read Best Practices for Designing a Pragmatic RESTful API. I agree with the author that pretty-printing makes sense for a REST API, but the constraints are different on the command line. I'll give the matter more thought.

starryknight64 commented 11 years ago

I also agree. There are way too many ways to already prettify JSON on a client to have this done server-side. I'd think efforts would be better spent minimizing the amount of white-space in a textual representation of a JSON object than increasing it.