verbose=0
fi
+FORMAT=clang-format-8
+if ! which $FORMAT 2> /dev/null; then
+ FORMAT=clang-format
+fi
+
+if [ $verbose = 1 ]; then
+ echo Using executable $FORMAT
+fi
+
for file in "${@}"; do
if [ -h "$file" -o ! -f "$file" ]; then
if [ $verbose = 1 ]; then
continue
fi
tmp=$(mktemp "$file.XXXXXXXX")
- if ! clang-format -style=file "$file" > "$tmp"; then
+ if ! $FORMAT -style=file "$file" > "$tmp"; then
rm "$tmp"
else
if ! cmp -s "$file" "$tmp"; then