amber icon indicating copy to clipboard operation
amber copied to clipboard

Add support to ignore filenames (by regex?)

Open EricCrosson opened this issue 4 years ago • 1 comments

Use case:

Sometimes I want to do an ambitious search or search/replace but I get a bunch of junk files I don't want to touch, like a CHANGELOG.md or a package-lock.json.

It would be nice to add an argument to ambs/ambr to ignore these files, e.g.

ambs --ignore-file '*.md' --ignore-file '*-lock.json' searchString

and

ambr --ignore-file '*-lock.json' fromString toString

The current workarounds I've been using are grep -v and trying to manually select 'no' on the replace query for the files I don't want to replace text inside. I can assure you, this is a very error prone process :sweat_smile:

EricCrosson avatar Dec 30 '20 15:12 EricCrosson

I'm running into the same issue, too. I'd like to be able to either ignore matching files or only include matching files.

For example I have a directory with a pattern like so:

.
├── account.go
├── account.repo.go
├── account.service.go
├── account_test.go
├── address.go
└── address_test.go

And I'd like to be able to call ambr on only the files ending with _test.go (or vice versa).

gf3 avatar May 20 '22 15:05 gf3