suppressing the line number in output

21 views
Skip to first unread message

Matt

unread,
Jun 21, 2008, 9:58:39 PM6/21/08
to ack dev/users
Hi,

I just installed ack for the first time -- great looking tool, thanks!

Is there any way to suppress the line number from the search output?
Apparently not, according to my quick read of the code; looks like
when $show_filename is true the line numbers will always be printed.

I have a specialized search tool that currently uses GNU egrep which
I'd like to adapt for ack, but I don't want line numbers in my output.
(But I *do* want the filenames in the output.) I suppose I can strip
them out by post-processing but it would be convenient if there was an
ack option to suppress them.

Thanks!
Matt

Andy Lester

unread,
Jun 21, 2008, 10:01:03 PM6/21/08
to ack-...@googlegroups.com

On Jun 21, 2008, at 8:58 PM, Matt wrote:

> Is there any way to suppress the line number from the search output?
> Apparently not, according to my quick read of the code; looks like
> when $show_filename is true the line numbers will always be printed.


No, there isn't. You're the first person to have wanted it.

I'm certainly open to suggestions. What would we call the option?
Are we going down the road of a generic printf-type output string?

--
Andy Lester => an...@petdance.com => www.petdance.com => AIM:petdance


Matt

unread,
Jun 22, 2008, 5:49:54 AM6/22/08
to ack dev/users
On Jun 21, 8:01 pm, Andy Lester <a...@petdance.com> wrote:
> No, there isn't.  You're the first person to have wanted it.
>
> I'm certainly open to suggestions.  What would we call the option?  

GNU grep calls their option --line-number, so how about --no-line-
number?

Thanks.
Matt
Reply all
Reply to author
Forward
0 new messages