ggreer/the_silver_searcher — pull request #59 by gjtorikian (2012-09-03 16:45:30+00:00)
Title: Adding option for path to specific .agignore

I noticed if you're searching a directory like _/foo/bar_, ag assumes you have an _.agignore_ listed there.

Well, what if I have my _.agignore_ listed in _/foo_, or listed in _/foo/bar/baz_ ?

I added a `-p` option to point to a specific _.agignore_ file. Paths can be literal or relative.

This is part of something larger I was working on, which is to allow for unrestricted / hidden file search. But then I noticed that there are actually a couple of options around this:

* `hidden`
* `unrestricted`

`hidden` was undocumented in the CLI message, so I added that too.

`unrestricted`, though documented in the manpage, is not in the CLI, and seems to do nothing at the moment. Is this something you are planning, or shall I flesh it out? Ideally `-p` would still work over `-u`, _i.e._, it's fine to ignore _.*ignore_ files that are in my project directory, but add the literal patterns in my specific _.agignore_.

![](http://gifsoup.com/webroot/animatedgifs7/2395692_o.gif)