Coder Social home page Coder Social logo

rename the `-r` option about ripgrep HOT 6 CLOSED

burntsushi avatar burntsushi commented on May 23, 2024 1
rename the `-r` option

from ripgrep.

Comments (6)

BurntSushi avatar BurntSushi commented on May 23, 2024

The -r flag is short for --replace, which pretty much does what it says on the tin: it replaces each match with the value given to the flag, expanding capturing groups if necessary.

Can you suggest an alternative shorthand for --replace?

from ripgrep.

durka avatar durka commented on May 23, 2024

You could use -s (like sed s/.../.../). But unfortunately s isn't one of the letters in replace :/

from ripgrep.

BurntSushi avatar BurntSushi commented on May 23, 2024

I'm sympathetic to this request. Muscle memory is tricky. But I really like -r as a short hand for --replace.

I'd prefer we try to fix this by making it clearer that rg will do recursive search. I added some clarification to the output of --help.

from ripgrep.

cmgbhm avatar cmgbhm commented on May 23, 2024

@BurntSushi Maybe at least include this warning in the README.md?. I found ripgrep a year or two ago (grep->ack->silversearcher)....

grep -r (recursive) memory getting confused -> ends up nuking lots of files. Fortunately, it was a fresh repo checkout but even figuring out what the glob actually replaced would have been a painful day in another directory :)

from ripgrep.

BurntSushi avatar BurntSushi commented on May 23, 2024

Maybe at least include this warning in the README.md?

It is: "ripgrep is a line-oriented search tool that recursively searches your current directory for a regex pattern."

grep -r (recursive) memory getting confused -> ends up nuking lots of files.

What? ripgrep doesn't nuke anything. I don't know what you're talking about. When complaining, please be specific.

from ripgrep.

cmgbhm avatar cmgbhm commented on May 23, 2024

Ack @BurntSushi; You're correct and it's my bad. I only saw it on the OUTPUT side and was bewildered :)

from ripgrep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.