Should I parse the json output now if I want to use ripgrep in rust? #1592
-
Should I parse the json output now if I want to use ripgrep in rust? My main goal is customizing the output format so I can parse the cleaned result easily with Originally posted by @NightMachinary in #1009 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
libripgrep is only about exposing the guts of what makes search work. There are no plans to expose the full CLI functionality of ripgrep as it exists today as a library. Most of ripgrep core is really just about parsing CLI flags and configuring the various grep dependencies to execute the search. If you want to build your own kind of tool that is as fast as ripgrep but has a different interface/objective/whatever, then libripgrep is what you want. If you just want to use ripgrep and all of its CLI functionality, then you should just call the |
Beta Was this translation helpful? Give feedback.
libripgrep is only about exposing the guts of what makes search work. There are no plans to expose the full CLI functionality of ripgrep as it exists today as a library. Most of ripgrep core is really just about parsing CLI flags and configuring the various grep dependencies to execute the search.
If you want to build your own kind of tool that is as fast as ripgrep but has a different interface/objective/whatever, then libripgrep is what you want.
If you just want to use ripgrep and all of its CLI functionality, then you should just call the
rg
process. If you want to change the output format, then you might be able to get away with massaging the default output format, but I don't know e…