Skip to content
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

the documentation for --replace should clarify that it doesn't write to files #147

Closed
samuelcolvin opened this issue Oct 4, 2016 · 2 comments
Labels
doc An issue with or an improvement to documentation.

Comments

@samuelcolvin
Copy link
Contributor

(This time I have had read the README properly, at least I hope so)

The documentation in the readme doesn't explicitly say that --replace actually writes the replacement to file, but neither does it say the opposite. I would have assumed "Search and replace" meant write changes to file.

The current functionally appears to replace correctly in the output, but provide no way (I can see) to write those changes to file:

samuel:~ || echo hello world > foo
samuel:~ || rg hello --replace "good bye" foo
1:good bye world
samuel:~ || cat foo
hello world

Same happens for recursive search and (don't) replace.

Again version 0.2.1 on ubuntu 16.04.

@BurntSushi
Copy link
Owner

Indeed, it does not. It was requested to do in #74, but I'm pretty firmly oppposed.

A "search and replace" isn't really a standard option. Even a tool like sed won't do it without explicitly asking for it.

I agree the docs could be clarified.

@BurntSushi BurntSushi changed the title --replace doesn't write to files the documentation for --replace should clarify that it doesn't write to files Oct 4, 2016
@samuelcolvin
Copy link
Contributor Author

I've continued the feature request on #74, personally I find sed a complete mind f**k and as you say it's not a standard option of other commands which is why I'm so keen for it here.

@BurntSushi BurntSushi added bug A bug. doc An issue with or an improvement to documentation. and removed bug A bug. labels Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc An issue with or an improvement to documentation.
Projects
None yet
Development

No branches or pull requests

2 participants