silver searcher ignore multiple directories
Asked Answered
G

2

50

using The silver searcher how can I ignore multiple directories?

I tried ag foo --ignore-dir dir1,dir2 but it doesn't work.

Goulet answered 13/4, 2016 at 14:17 Comment(0)
G
47

you can specify the argument multiple times

ag foo --ignore-dir dir1 --ignore-dir dir2

Goulet answered 13/4, 2016 at 14:21 Comment(0)
C
63

You an also do this (without needing to repeat the flag):

ag foo --ignore-dir={dir1,dir2}

You need to use this format with more than one directory. Otherwise, if it's with just one directory, you'd need to provide a comma, like: ag foo --ignore-dir={dir1,}.

Chancelor answered 5/2, 2018 at 21:5 Comment(2)
Make sure there is no space after the comma. I had issues with this.Virescence
You can also simply use --ignore instead of --ignore-dirPinta
G
47

you can specify the argument multiple times

ag foo --ignore-dir dir1 --ignore-dir dir2

Goulet answered 13/4, 2016 at 14:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.