Is it possible to add a -G option to ~/.ackrc
When I do
ack -G "^.*$" "foo"
I get results... but when I put
-G "^.*$"
or
-G="^.*$"
or
-G
"^.*$"
in my `~/.ackrc/ I get no results... Does anyone know if 开发者_如何转开发-G can be used in ackrc?
It's a quoting problem. When executed on the command line:
$ ack -G="^.*$"
ack actually sees the following command line option (after quote processing by the shell)
-G=^.*$
without the quotes. Since the ~/.ackrc
file is read without shell quote processing, place the above line without quotes into ~/.ackrc
.
Update: That was only half of it. It looks like you need to use the following line in ~/.ackrc
:
-G^.*$
I'm not completely sure why the =
is not permitted there, but including it makes it part of the pattern, which is obviously not what you want.
You could alias ack to ack -G ?
精彩评论