3 ms·
Not natively, no. You could probably write a simple script that transforms the output into what you want though. For example, on Unix at least, rg -n patte
by burntsushi 8y ago
Not natively, no. You could probably write a simple script that transforms the output into what you want though. For example, on Unix at least,
rg -n pattern | sed 's/:/(/' | sed 's/:/)/'
That won't work in every case (e.g., in the case of a file path containining a `:`), but it might get you pretty far. And it could probably be made more precise.
Otherwise, you could always use ripgrep's --json output mode to craft its output into whatever format you like, but that's probably more work. :-) The JSON format is documented here: https://docs.rs/grep-printer/0.1.2/grep_printer/struct.JSON.html https://docs.rs/grep-printer/0.1.2/grep_printer/struct.JSON....