jless icon indicating copy to clipboard operation
jless copied to clipboard

Feature request: add search/filter à la jq

Open gennaro-tedesco opened this issue 2 years ago • 2 comments

jless is awesome, thank you very much for your work on it!

Description of the feature:

At the moment jless search works à la Vim, searching back and forth for patterns with /?; in particular the documentations says:

The search is not performed over the original input, but over a single-line pretty formatted version of the input JSON.

would it be possible to introduce some sort of jq grammar where we can filter via, say

.key <-- get values of nested key
[] <--- get array elements
select(.key|test("<regex>") <--- search for regex and return key or value

and similar? Or is this already present and I overlooked it?

Thank you again for the great work!

gennaro-tedesco avatar Mar 11 '22 11:03 gennaro-tedesco

Options available for this:

  • xq - pure rust implementation of jq, it's still under development.
  • jq_rs - rust bindings for libjq via C api.

hoshsadiq avatar Mar 17 '22 22:03 hoshsadiq

This could be an alternate implementation of #80. Or maybe #80 could be a hot-key for this filter.

VimCommando avatar Apr 14 '22 18:04 VimCommando