sd icon indicating copy to clipboard operation
sd copied to clipboard

Feature request: Skip line if regex does not match.

Open guettli opened this issue 2 years ago • 3 comments

Thank you for sd it is fast and easy to use.

At the moment sd prints the line unchanged, if the regex does not match.

It would be nice to have an option to skip lines where the regex does not match.

guettli avatar Jun 29 '22 13:06 guettli

There's a draft PR adding diff support #238. Would that be sufficient for what you're talking about, or do you have something different in mind?

CosmicHorrorDev avatar Oct 22 '23 00:10 CosmicHorrorDev

Or did you have something more like #150 in mind?

CosmicHorrorDev avatar Oct 22 '23 00:10 CosmicHorrorDev

Would be useful when running on large files. The --diff is better than printing the whole file (as it is now), but may still be insufficient for changes made to many consecutive lines. See my comment: https://github.com/chmln/sd/pull/238#issuecomment-1865998043

I would personally like to have #150 regardless of --diff ☺️

alexilyaev avatar Dec 21 '23 10:12 alexilyaev