today I came across ack and I really like it. But it misses a feature
important to me. When filenames are displayed I want to be able to
choose display of absolute paths.
I modified ack and added the -F option to support that. If you have
comments on it please email me.
regards,
Henning
That seems reasonable. Not sure I'm going to give it a single-
character option, though.
Don't suppose you wrote a test for it?
xoa
--
Andy Lester => an...@petdance.com => www.petdance.com => AIM:petdance
Any comments from other ack users on this idea?
On Thu, 12 Feb 2009 23:12:24 +0100
Henning Schild <hen...@wh9.tu-dresden.de> wrote:
> Hi,
>
> today I came across ack and I really like it. But it misses a feature
> important to me. When filenames are displayed I want to be able to
> choose display of absolute paths.
>
> I modified ack and added the -F option to support that. If you have
> comments on it please email me.
>
> regards,
> Henning
I can see how it would be a valuable feature. I agree that it doesn't
deserve a short option though.
--
Michael
>> > today I came across ack and I really like it. But it misses a
>> > feature important to me. When filenames are displayed I want to be
>> > able to choose display of absolute paths.
then give it an absolute name to start with. Instead of
ack pattern
give it
ack pattern $PWD
And when you're explicitly giving paths, like
ack pattern ../subdir
give it
ack pattern /absolute/path/of/subdir
etc.
>> >
>> > I modified ack and added the -F option to support that. If you have
>> > comments on it please email me.
>>
>> Any comments from other ack users on this idea?
>
> I can see how it would be a valuable feature. I agree that it doesn't
> deserve a short option though.
I agree. I also think this too could be rolled into a printf-style
generic output formatter, along with the other request about column
numbers.
> then give it an absolute name to start with. Instead of
> ack pattern
> give it
> ack pattern $PWD
>
> And when you're explicitly giving paths, like
> ack pattern ../subdir
> give it
> ack pattern /absolute/path/of/subdir
Thank you for pointing that out, but I already knew that. The reason
for wanting an option is that in can be made default behavior with the
option in ~/.ackrc or an alias.
Henning
> Thank you for pointing that out, but I already knew that. The reason
> for wanting an option is that in can be made default behavior with the
> option in ~/.ackrc or an alias.
I don't see that grep has an option for this. What would you do if
you were doing this with grep? Or would you just punt?
> Thank you for pointing that out, but I already knew that. The reason
> for wanting an option is that in can be made default behavior with the
> option in ~/.ackrc or an alias.
And allowing those options is part of the ack philosophy. To me, the
idea of "Can't you get this functionality by doing this harder thing
that takes longer to type?" is antithetical to ack. Nobody wants to
specify $PWD every time, and you shouldn't have to.
> Thank you for pointing that out, but I already knew that. The reason
My apologies -- I didn't mean it to sound whatever it apparently sounded like.
> And allowing those options is part of the ack philosophy. To me, the
> idea of "Can't you get this functionality by doing this harder thing
> that takes longer to type?" is antithetical to ack. Nobody wants to
> specify $PWD every time, and you shouldn't have to.
And yet I would consider column numbers to be even more
important/useful, but you preferred a printf-style thing for that a
few emails ago...
I was trying to be consistent with what *you* said, ironically.
> I don't see that grep has an option for this. What would you do if
> you were doing this with grep? Or would you just punt?
Punt or use a script for it.
Henning
> And yet I would consider column numbers to be even more
> important/useful, but you preferred a printf-style thing for that a
> few emails ago...
>
> I was trying to be consistent with what *you* said, ironically.
No, I agree, an ACK_FORMAT string would be great. Everyone could make
their own and stick it in their /etc/ackrc files and the world would
be a fabulous place.
Any comments from other ack users on this idea?
Sorry for bump this old thread but I'm also looking for a way to display full paths whenever file names are displayed in ack. Is there a solution in 1.96 or will there be one in the future?