3 ms·
You mean? cat json | jq | less I checked the code, it's concatenating the output with newlines. Not necessary at all.
by kissgyorgy 6y ago
You mean?
cat json | jq | less
I checked the code, it's concatenating the output with newlines. Not necessary at all.
- salmo 6y agoYay, useless use of cat. I think you mean jq . < json | less Sorry for being pedantic. Moving on.
- mason55 6y agoYes, you can re-write it without using cat, but many people (including me) think it's clearer to read from left-to-right. Plus the mixing of sending the file through stdin and then using a pipe always makes my brain pause. I just personally find that using cat as the first part of the pipeline makes everything easier. Plus, if you're going to argue against useless use of cat, there's also no reason to send the file in through stdin. jq can read the file directly.
- hombre_fatal 6y agoAgreed. Keeping the source on the far left (whether cat or curl) just makes things easiest to follow.
- amake 6y agoYou can put `<json` on the left no problem. (But it makes the pipeline harder to edit so actually I have no problem with `cat JSON`)
- vially 6y agoThe input redirection pipe is not necessary either: jq . json | less
- nicwolff 6y agoI think you mean < json jq . | less
- mthoms 6y agoIt's not useless if it makes it much more readable :)
- tlrobinson 6y agoCongrats on saving two characters?
- snidane 6y agoIf you want to preserve colors: jq . -C | less -R
- atombender 6y agoNo, that's not what it does. To be fair, the readme doesn't explain it well. This is a GUI app that allows you to see the jq results in real time. Here [1] is a video. [1] https://gfycat.com/oddtartbrahmanbull https://gfycat.com/oddtartbrahmanbull