Created
June 18, 2015 15:43
-
-
Save klainfo/e37c8dcbf7037a834290 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# C++ functions parser | |
# Reference: http://stackoverflow.com/questions/6133989/what-grep-command-will-include-the-current-function-name-in-its-output | |
# Usage: ./cpp-parser.sh <file.cpp> | |
awk -v re='return' '/^[[:alpha:]]/{f=FNR"-"$0} $0~re{printf "%s\n%d:%s\n--\n",f,FNR,$0; f="" }' $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment