sd icon indicating copy to clipboard operation
sd copied to clipboard

Feature request: argument to exit non-zero if it failed to match

Open kergoth opened this issue 3 years ago • 1 comments

It would be helpful in some scripting and buildsystem work to be able to catch the case where what we're looking to replace didn't exist in the input, so an argument to exit non-zero if nothing matched would be helpful. I'm in particular thinking of times when I've typoed what I'm trying to replace when using sed, or when using sed to correct bugs in upstream project sources or makefiles and they've changed something in a version bump.

kergoth avatar Sep 17 '20 17:09 kergoth

I actually think this should be the default and not just when providing a flag.

tyilo avatar Dec 10 '21 12:12 tyilo

This one is older, but I'm going to close this in favor of #157 which has more recent discussion on how this will go

The current consensus was to add this functionality under some flag like --must-match. I don't think it's a good idea to change the default behavior because it deviates from sed more than I would like on behavior that people would likely expect to remain consistent

CosmicHorrorDev avatar Oct 22 '23 03:10 CosmicHorrorDev