Skip to content

Commit

Permalink
make loc smarter
Browse files Browse the repository at this point in the history
  • Loading branch information
rntz committed Aug 27, 2014
1 parent 4463f01 commit fb6d222
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions loc
@@ -1,3 +1,12 @@
#!/bin/sh
#!/bin/bash
# counts lines of code, ignoring whitespace & comments
cat *.rkt | egrep -v '^ *(;.*)?$' | wc -l

filter() {
egrep -v '^ *(;.*)?$|^#lang ' "$@"
}

for name in *.rkt; do
printf "%5d %s\n" $(filter "$name" | wc -l) "$name"
done | sort -n

printf "%5d total\n" $(filter *.rkt | wc -l)

0 comments on commit fb6d222

Please sign in to comment.