Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find declaration and definition of function using bash

Tags:

bash

I am having a look af a big C++ project with more than 100 files. Given a certain function name, how can one find just using bash tools like find or grep, the declaration and the defintion of a function?

Thanks

like image 626
Open the way Avatar asked Mar 13 '10 16:03

Open the way


1 Answers

Try ack, which is way better than grep. Color highlighting, the works...

$ ack funcion_name

Prints out all uses of function_name searching recursively through source files, it also is smart enough to ignore .svn and other metadata

like image 169
Sam Post Avatar answered Sep 18 '22 18:09

Sam Post