2016-11-25 05:49:37 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
main() {
|
|
|
|
if [ $# -lt 2 ]; then
|
2018-05-01 11:49:22 -04:00
|
|
|
echo "$0 build_path [-fix] DIR..." 1>&2
|
2016-11-25 05:49:37 -05:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
args="-p $1"; shift
|
|
|
|
|
|
|
|
if [ "$1" = "-fix" ]; then
|
|
|
|
args="${args} -fix"; shift
|
|
|
|
fi
|
|
|
|
|
2018-05-01 11:49:22 -04:00
|
|
|
# Search paths
|
|
|
|
search="${*:-.}"
|
|
|
|
|
|
|
|
echo "$0 in $search"
|
|
|
|
|
2016-11-25 05:49:37 -05:00
|
|
|
# shellcheck disable=2086
|
2018-05-01 11:49:22 -04:00
|
|
|
find $search -iname "*.cpp" \
|
|
|
|
-exec printf "\\033[32;1m** \\033[0mProcessing %s\\n" {} \; \
|
|
|
|
-exec clang-tidy $args {} \;
|
2016-11-25 05:49:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|