tre icon indicating copy to clipboard operation
tre copied to clipboard

Add the m option (from grep).

Open ovhpa opened this issue 2 years ago • 1 comments

I wanted to stop agrep after N matches, so I add a -m option as close as possible to that of the GNU grep.

I'm sharing this in the hope that it will be useful to someone else.


Note: When using -m combined with the -B option, agrep will look for the N-best candidates.

ovhpa avatar Sep 11 '23 06:09 ovhpa

This looks reasonable, but I want to test it offline first and it will be a week or two before I can do that. Thanks for this (in advance)!

trushworth avatar Sep 21 '23 03:09 trushworth

Bonjour @dag-erling,

Thank you very much for your review. I added that option quickly for a use case. But to be honest, it was a single-use and quite a long time ago so I forgot about the details, I am very sorry for that m(_ _)m

Anyway, your PR is surely more thoughtful so you can ignore this one!

Have a nice day,

ovhpa avatar Sep 04 '24 16:09 ovhpa

merged #110 instead

dag-erling avatar Sep 04 '24 17:09 dag-erling