cgrep

Context-aware grep for searching source code with syntax understanding

brewmacoslinux
Try with needOr install directly
Source

About

Context-aware grep for source code

Commands

cgrep

Examples

Search for function definitions in C/C++ code$ cgrep -fun 'myFunction' src/
Find all variable declarations across source files$ cgrep -decl 'variableName' .
Search for specific patterns while excluding comments$ cgrep -nocom 'pattern' src/ --include='*.cpp'