Created
November 2, 2012 18:47
-
-
Save davidchambers/4003513 to your computer and use it in GitHub Desktop.
Visualize significant lines of code for a directory of source files
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
#!/usr/bin/env bash | |
echo | |
for filename in $(find $1); do | |
loc=$(sed /^\s*$/d $filename | wc -l) | |
printf %24s $(echo $filename | sed 's!.*/!!') | |
printf %8s $loc | |
echo -n ' ' | |
indent=$(seq -s ' ' 36 | sed s/[0-9]//g) | |
seq -s '+' $loc | sed -e s/[0-9]//g -e "s/.\{100\}/&,$indent/g" | tr , '\n' | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment