Open digger18 opened 7 years ago
This shouldn't really be an issue ticket. It's not an issue with the code itself, nor does it seem to even be a feature request.
You haven't said what you've tried, nor have you specified whether you're using the jq
binary from the command line, or the jq
python module, or something else.
From the command line there are lots of ways to format text. That's a pretty trivially solved problem. Removing leading whitespace is also a pretty trivially solved problem. You could use sed
, or possibly json_pp
, or any number of other tools.
That having been said, I just tested --indent 0
, and that... behaves really weirdly in that it also causes suppression of newlines. Which feels like a bug. And I'll file an issue ticket for that if it doesn't already exist. But this... is not that ticket.
It should be noted that jsonlint (a common json formatter/checker) ALSO doesn't do this.
{
"name": "configuration",
"version": "1.0.0",
"description": "settings",
"parameters": {
"threshold": [
[
0.7,
0.7
],
0.7,
0.7
],
"margin": [
0,
0,
0,
0
],
"type": "frame"
}
}
I was unable to "de-beautify" arrays after a simple select with jq.
Example Input (less.json): {"name":"configuration","version":"1.0.0","description":"settings","parameters":{"threshold":[[0.7,0.7],0.7,0.7],"margin":[0,0,0,0],"type":"frame"}}
I want to beautify the json but keep the arrays on a single line without new-lines after each element, as in this example:
My intended result will look like:
How can I achieve this?