You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
496 B
15 lines
496 B
5 years ago
|
#!/bin/bash
|
||
|
|
||
|
# Usage example:
|
||
|
# ./count-function.sh ":" "((map)|(fmap))" "((foldr)|(foldl'?))" "filter" \
|
||
|
# "reverse" "take" "drop" "sum" "zip" "product" "maximum" "minimum"
|
||
|
|
||
|
|
||
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||
|
|
||
|
echo "Searching for occurrences in subdirectories of $dir"
|
||
|
for func in "$@"; do
|
||
|
occurrences="$(rg --type hs " $func " --count-matches | awk -F ':' '{sum += $2} END {print sum}')"
|
||
|
echo "Found $occurrences occurrences of \"$func\""
|
||
|
done
|