You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When piping output to a filter, we have to set --break=0 because otherwise
the spaces can affect things.
Specifically, I did this:
$ ack foo
and saw all the results and wondered how many there were, so I did
$ ack foo | wc -l
which gave me 109, which seemed high, so I did
$ ack foo --nogroup | wc -l
and got 72. Bad bad bad.
Delete comment
Comment 1 by torsten.blix, May 05, 2008
Is this fixed already?
I can't reproduce it. Doing
$ ack foo | wc -l
in the ack svn checkout, I get 53 hits. The same amount as I get with --nogroup.
And looking in the code, the break option defaults to $to_screen which should be 0
when piping ...
Delete comment
Comment 2 by petdance, May 06, 2008
It's coming from my .ackrc. It looks like this.
Always sort
--sort-files
I'm tired of grouping
--noheading
--break
Delete comment
Comment 3 by torsten.blix, May 09, 2008
Ahh, I see, ok.
The problem with this is that then there is no way to specify that you DO want to
have breaks in your output when it is going to a file/piped. This breaks for example
a couple of our tests.
Or are you suggesting that just the --break option specified in the .ackrc file - and
NOT the --break option given on the command line - is to be ignored when piping? This
would leave the tests alone but would require some more thoughts on the
implementation and would introduce more complexity for the user in understanding the
subtle differences between command line and .ackrc.
The text was updated successfully, but these errors were encountered:
Reported by petdance, Apr 07, 2008
When piping output to a filter, we have to set --break=0 because otherwise
the spaces can affect things.
Specifically, I did this:
$ ack foo
and saw all the results and wondered how many there were, so I did
$ ack foo | wc -l
which gave me 109, which seemed high, so I did
$ ack foo --nogroup | wc -l
and got 72. Bad bad bad.
Delete comment
Comment 1 by torsten.blix, May 05, 2008
Is this fixed already?
I can't reproduce it. Doing
$ ack foo | wc -l
in the ack svn checkout, I get 53 hits. The same amount as I get with --nogroup.
And looking in the code, the break option defaults to $to_screen which should be 0
when piping ...
Delete comment
Comment 2 by petdance, May 06, 2008
It's coming from my .ackrc. It looks like this.
Always sort
--sort-files
I'm tired of grouping
--noheading
--break
Delete comment
Comment 3 by torsten.blix, May 09, 2008
Ahh, I see, ok.
The problem with this is that then there is no way to specify that you DO want to
have breaks in your output when it is going to a file/piped. This breaks for example
a couple of our tests.
Or are you suggesting that just the --break option specified in the .ackrc file - and
NOT the --break option given on the command line - is to be ignored when piping? This
would leave the tests alone but would require some more thoughts on the
implementation and would introduce more complexity for the user in understanding the
subtle differences between command line and .ackrc.
The text was updated successfully, but these errors were encountered: