beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 140 forks source link

Request for -a... #470

Closed ambs closed 10 years ago

ambs commented 10 years ago

Hello Sorry if this was an issue already discussed. If so, just close the ticket, and I am sorry for that.

If now, it would be great to reconsider the -a option. I know I can configure mimetypes. But for some quick hacks the -a option was just great. A quick and dirty way to find things.

Best, ambs

hoelzro commented 10 years ago

Hi @ambs,

I couldn't find an issue that corresponded to this, but I'm pretty sure this has been discussed on the mailing list. I'm sorry, but -a is not coming back. That doesn't mean, however, that we can't help you by giving you advice or improving the docs. How did -a help you out in ways that ack 2.x's default search behavior doesn't?

ambs commented 10 years ago

Hey

Correct me if I am wrong, but if you search on a folder with files that have unknown extensions, they will be ignored. I have tons of files whose extensions are 1.10, 1.11, 1.12.. etc. I do not want to define these extensions anywhere, would love just to grep on them :-)

Thanks

hoelzro commented 10 years ago

Nope, you don't need to define those extensions! ack 2.x defaults to searching all text files:

$ echo 'hello world' > 1.10
$ ack hello
1.10
1:hello world
ambs commented 10 years ago

Herm, something is very strange here...

Let's see:

[ambs@stravinski math--gsl]$ cpanm -S App::Ack
App::Ack is up to date. (2.12)
[ambs@stravinski math--gsl]$ ack --version
ack 1.96
Running under Perl 5.20.0 at /opt/perl/bin/perl
[ambs@stravinski math--gsl]$ which ack
/opt/perl/bin/ack

and finally, editing that file,

our $VERSION = '2.12'; # Check http://beyondgrep.com/ for updates

Something strange here :-)

ambs commented 10 years ago

Ah, hash -r and now I have ack 2.12!

ambs commented 10 years ago

And yep, it is working. Sorry :(