-
-
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
--output like Ack (or: rethink --replace) #308
Comments
Ack's
Which has the same output. The
Hmm, yes, I'm actually not familiar with those perlisms. :-) |
Huh, indeed, it didn't occur to me at all to use Since they are fully isomorphic, if there's no intention to change how |
Yeah, I can see how --output might be more convenient. Tricky issue. I think we can at least improve the docs of --replace to include an example that replaces the entire line. |
Just saw #34, about the grep feature
|
@mernen Good point. It actually didn't occur to me that |
First, a question: what exactly is the use case for
--replace
? I don't think I've ever seen any other tool offering this option, and I can't think of many uses.I do, though, find Ack's
--output
useful every now and then. It's a similar feature, but it replaces the contents of the entire line rather than only the matched part. When coupled with-h
(hiding line numbers and file names), it allows one to pipe the results to other tools to get statistics about the matches in ways I'm not sure how I'd achieve with ripgrep (or other competitors, for that matter).(ripgrep's
--replace
can be fully emulated in Ack using$`
and$'
in the output expression, but those perlisms are rather cryptic, and also pretty awkward to use on the CLI)The text was updated successfully, but these errors were encountered: