piranha / goreplace

command line tool for search and replace
ISC License
185 stars 14 forks source link

multiple -o --only and -x --exclude parameters #26

Closed SamHasler closed 10 years ago

SamHasler commented 10 years ago

I know I can combine them into single REs but I want to have aliases to often used searches and multiple -o / -x would allow me to refine these searches.

piranha commented 10 years ago

But they are already like that. :) I wonder if there is a more or less standard way to mark them in the help output so it'll be easier to understand they can be used multiple times.

piranha commented 10 years ago

Marked them somewhat in 2.1, so they will be easier to discover.

SamHasler commented 10 years ago

I'd assumed that several -o would restrict it to the intersection of all matches, not the union. Is there a way to restrict a search to scss files with a "foo" directory somewhere in it's path?

piranha commented 10 years ago

Well, it's actually a union, not an intersection. :) So -o foo -o scss will find search in scss files and in foo dirs. The easiest way I thought of for your question is -o 'foo.*scss'.