-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json output option to allow scripting #359
Comments
I think what you're asking for is "structured output," where JSON might be your preference. In that case, I think this is a dupe of #244. To be clear, I do not want to be in the business of producing a bunch of different output formats because there is so much complexity involved. (Every option that influences output has to be considered against the new format.)
While I'm in favor of adding some type of structured output to ripgrep, I would rather see these types of tools built with libripgrep than with ripgrep itself. |
|
Then this should be closed as a duplicate. There are many options, and their effects all need to be individually reasoned through.
Please see the link in my previous comment. It's not done yet. Libripgrep refers to a collection of libraries. The endgame is to make ripgrep itself very small with most logic in reusable libraries. A lot of it is already done.
Someone (probably not me) will need to put in the work to build a C interface, and then ffi bindings for their favorite language. |
Could we have a json output option?
use case: making it easier to integrate in other tools [1]
eg:
offset corresponds to byte offset in file (useful for efficient access for the other tool)
length is in bytes (in case of non-ascii)
The alternative (manual parsing) is error prone, eg:
foo/bar:13:foo.txt
(contains:
)[1] NOTE: one of these other tools is multiline search built on top of ripgrep
The text was updated successfully, but these errors were encountered: