Skip to content

With the --json flag, how can I request that the "lines" section of the JSON is omitted? #2821

Answered by BurntSushi
RecRanger asked this question in Q&A
Discussion options

You must be logged in to vote

Nope. You'll have to filter it out yourself. I'm not keen on adding different incompatible subsets of the JSON format.

I note that this generally shouldn't change the memory requirements. ripgrep already requires that each line, in full, is put on the heap. It does mean some extra deserialization/serialization work, but that should hopefully be pretty fast. And the additional memory requirements should be minimal if you do it one JSON line at a time.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RecRanger
Comment options

Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants