ack, my replacement for grep for 95% of the times programmers use grep, just got released to CPAN with version 1.70.
At long last, you can now get contextual lines before and after matched lines, just like GNU grep's -A, -B and -C options. You can also match on a specific line number or range of line numbers with the new --line option. For example, if you want to see the first line of every Perl file in a tree, you'd just do ack --line=1 --perl. Thanks very much to Torsten Biix for putting both these features together for me.
Finally, Elliot Shank pointed out that one of my favorite features, the -1 option, was never documented. Now it is. The -1 option says "stop after the first match of any type." If you find yourself acking for lines, or searching for a specific file with ack -g and then having to Ctrl-C to stop the search process, just add a -1 and Ctrl-C no longer.
ack is available in the ack distribution on CPAN, or by installing the module App::Ack from the CPAN shell. You can also download the single-file version direct from Subversion and drop it right into your ~/bin directory.
*sob* (Score:1)
http://rt.cpan.org/Public/Bug/Display.html?id=24670 [cpan.org]
is still not resolved *sob*
When using ack from within Emacs on Windows (yah, a bit of a corner case there), the tty vs pipe makes ack confused.
And I was so close to emailing you last night asking when you were planning the next release
Thanks! (Score:1)
Re: (Score:2)
--
xoa
Re: (Score:1)
So, I just copied ack-standalone into ~/bin on one of the servers and it worked great.
Re: (Score:2)
--
xoa
Re: (Score:1)
Re: (Score:1)
If others are anything like me, then the problem isn’t that people don’t figure out what “standalone” means, it’s that they install
ackfrom CPAN and never bother to look at its website (let alone the Google Code project). But there is no mention ofack-standalonewhatsoever in the distro docs (ie. the parts that search.cpan.org exposes prominently), save for a passing one in theChanges. Not even the installation instructions in theREADMEsay anything about it. I knew it exis