Add function declaration search flag #211

ericandrewlewis opened this Issue Feb 22, 2012 · 2 comments

2 participants


To search for a function declaration, you would do something like this:

ack "function myfunction("

As function definitions share the same syntax mostly across languages, perhaps we could simplify this into an option in ack search? so that you could do something like

ack --function myfunction

Of course the option could be something shorter, just a start for discussion.


What's the use case for this? Only wanting to find the one place a given function was declared? Like

ack --function write_record

and then the single hit would come back    sub write_record {

Is that a big enough win to make it better than

ack '^sub write_record'


Not arguing. Trying to understand.


Yeah it's debatable.

I used a custom shell command to do my searching through WordPress core before using ack, and I just prefer the ease of syntax to add a one letter option rather than spelling out "function function_name" as a parameter

@petdance petdance closed this Apr 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment