ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.

Home Page:http://geoff.greer.fm/ag/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add optional padding parameter to -o.

dotancohen opened this issue · comments

Often search strings need context, this is why the -A, -B, and -C flags exist. Having such context on the -o flag would be great as well.

Current behavior:

$ cat one.txt 
This is a foo file.

$ cat two.txt 
This is another foo file.
With an additional foo line.

$ ag -o foo
two.txt
1:foo
2:foo

one.txt
1:foo

$ ag -o 5 foo
ERR: Error stat()ing: foo
ERR: Error opening directory foo: No such file or directory

Desired behavior:

$ ag -o 5 foo
two.txt
1:ther foo file
2:onal foo line

one.txt
1:is a foo file