- Code: Select all
grep -rnH --color \
--include='*.cobra' \
-P '^[ \t]*(namespace|class|interface|struct|mixin|enum|const|var|cue|def|get|set|pro)[ \t]+[A-Za-z0-9_\.]+\b' \
.
Well actually that should work with any shell as long as you have "grep".
It scans all subdirs as well through the -r option.
This was fairly easy because Cobra declarations always start with "<keyword> <identifier>" such as "class Customer" and "def clear".