#!/bin/sh
dir=$(dirname "$(readlink -f "$0")")
which astyle &> /dev/null || ( echo "Please install astyle." && exit 1 )

out=$(astyle --formatted --options=$dir/astyle.options $(find ../app ../fly-ocr ../plugins \(  -name '*.cpp' -or -name '*.h' \)))
echo "$out"
[ -z "$out" ] && exit 0 || exit 1
