lizmat / App-Rak

21st century grep / find / ack / ag / rg on steroids
https://raku.land/zef:lizmat/App::Rak
Artistic License 2.0
154 stars 8 forks source link

Multiline replace #56

Closed greenfork closed 3 months ago

greenfork commented 4 months ago

Thank you for this awesome binary!

I have a use case to perform multiline replacements in code, here is an example. For this file text.txt:

Multi

line

I can do matching with rak --per-file '/Multi\n\nline/' text.txt but I can't also specify the --modify-files option because it complains:

Can only have one action at a time: '--modify-files' was specified before '--per-file'

Are there any hard-blockers to implement multiline replacement or someone just needs to implement it?

lizmat commented 4 months ago

Thanks for he report!

I'll see I can get this into the next release. On which I will be working after getting this week's Rakudo Weekly News out of the door today :-)

lizmat commented 4 months ago

Meh, looks like this needs a re-think of the way --per-line and --per-file work. So I doubt a fix for this will be seen today. Sorry.

greenfork commented 4 months ago

Sure, thank for looking into it! My problem is solved by manual labor :( no rush for me right now :^)

lizmat commented 3 months ago

Release 0.3.5 fixes this issue.

Thanks again for reporting!