2016-11-25 10:49:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
main() {
|
|
|
|
if [ $# -lt 1 ]; then
|
2018-05-01 15:49:22 +00:00
|
|
|
echo "$0 DIR..." 1>&2
|
2016-11-25 10:49:37 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2018-05-01 15:49:22 +00:00
|
|
|
|
|
|
|
# Search paths
|
2016-11-25 10:49:37 +00:00
|
|
|
search="${*:-.}"
|
|
|
|
|
2018-05-01 15:49:22 +00:00
|
|
|
echo "$0 in $search"
|
2016-11-25 10:49:37 +00:00
|
|
|
|
|
|
|
# shellcheck disable=2086
|
|
|
|
find $search -regex ".*.[c|h]pp" \
|
2018-05-01 15:49:22 +00:00
|
|
|
-exec printf "\\033[32;1m** \\033[0mFormatting %s\\n" {} \; \
|
2016-11-25 10:49:37 +00:00
|
|
|
-exec clang-format -style=file -i {} \;
|
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|