Open optik-aper opened 4 years ago
@optik-aper did you ever figure this out by any chance? I just run into the same issue:
ag --nonumbers 1596042841 somelogs.log -m1
ERR: Too many matches in somelogs.log. Skipping the rest of this file.
### TIMESTAMP: 1596042841 - 1/2880 - pidstat duration: 30 ###
grep is happy though:
grep 1596042841 somelogs.log -m1
### TIMESTAMP: 1596042841 - 1/2880 - pidstat duration: 30 ###
EDIT: looks like it's the same as this? https://github.com/ggreer/the_silver_searcher/issues/483
also stumbled on this, definitely a bug.
Trivial test case:
❯ echo "a\na" | ag -m1 a
ERR: Too many matches in . Skipping the rest of this file.
a
ERR: Too many matches in . Skipping the rest of this file.
a
❯ echo "a\na" | grep -m1 a
a
Adding -F
and/or -s
doesn't help.
Environment: macOS Catalina, ag installed from homebrew.
No updates since version 2.2.0 release almost 3 years ago and over 300 issues. This is very sad but it seems this project has been abandoned. I love ag
and use it far more than any other search tool, even though I have several installed. Are there any known active forks?
I'm trying to get ag to stop at the first match because I don't care about the loopback address in ifconfig. But for some reason it seems to be searching the piped output twice:
Is there some parallelization causing ag to read from the pipeline multiple times? What's going on here? It's not what I'd expect and it's not how
grep
works:Version: