sd
sd copied to clipboard
Feature request: argument to exit non-zero if it failed to match
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.
I actually think this should be the default and not just when providing a flag.
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