ajson icon indicating copy to clipboard operation
ajson copied to clipboard

pretty print output

Open prashanth-hegde opened this issue 3 years ago • 1 comments

It seems ajson command line does not pretty print output. Can we support a pretty print output, even if by providing a command line switch?

prashanth-hegde avatar Oct 29 '21 17:10 prashanth-hegde

Hi! yes, I suppose it will be a good update, but for the v1.0.0 version. Mostly because of the amount of additional work: -pretty to enable pretty print, -no-color to remove color output, etc. ajson tries to avoid unnecessary work, so if underlying data was not changed, it will be printed as it was given.

Right now I use an additional call for jq ., as an example:

ajson "$.results.*.name" "https://randomuser.me/api/?results=10" | jq .

spyzhov avatar Oct 29 '21 20:10 spyzhov