1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-08-04 21:52:54 +02:00
Files
ripgrep/crates/printer
Stephan Badragan cf91d6e67a printer: support -r/--replace with --json
This adds a `replacement` field to each submatch object in the JSON
output. In effect, this extends the `-r/--replace` flag so that it works
with `--json`.

This adds a new field instead of replacing the match text (which is how
the standard printer works) for maximum flexibility. This way, consumers
of the JSON output can access the original match text (and always rely
on it corresponding to the original match text) while also getting the
replacement text without needing to do the replacement themselves.

Closes #1872, Closes #2883
2025-07-26 11:35:08 -04:00
..
2024-09-08 22:10:29 -04:00
2021-06-01 21:07:37 -04:00

grep-printer

Print results from line oriented searching in a human readable, aggregate or JSON Lines format.

Build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/grep-printer

NOTE: You probably don't want to use this crate directly. Instead, you should prefer the facade defined in the grep crate.

Usage

Add this to your Cargo.toml:

[dependencies]
grep-printer = "0.1"