Last active
February 6, 2018 15:21
-
-
Save arathunku/5ce5ad8ebab30bd3b9ad4fcdd29c7582 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
#!/usr/bin/env bash | |
file_with_methods="${1?Pass filename}" | |
# set -e | |
( | |
IFS=' | |
' | |
for line in `rg "def (\w+)" ${file_with_methods} -r '\$1' -o --no-line-number`; do | |
COUNT="$(rg $line -F . | wc -l)" | |
if test $COUNT -gt 1; then | |
echo "${line} used ${COUNT}" | |
else | |
echo "${line} unused" | |
fi | |
done | |
) |
Author
arathunku
commented
Feb 6, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment