2
# Applies astyle on all source files
3
# usage: beautify <source directory> <tagfile> <astyle-options>
4
# if the sources should stay untouched or
5
# beautify -t <source directory> <tagfile> <astyle-options>
6
# if changed sources should be marked
14
if test "$SRCDIR" = "-t"; then
23
# mark tag file as really old file so everything will be beautified at first
24
test -r $TAGFILE || touch -t 198001010000 $TAGFILE
26
# find all edited source files
27
for f in `find $SRCDIR \( -name \*.cpp -o -name \*.h \) -a -cnewer $TAGFILE`; do
32
astyle $f.beautify "$@"
34
# test and touch/move back to original
35
test "$TOUCH" = "false" && touch -r $f $f.beautify
36
diff $f.beautify $f > /dev/null || mv $f.beautify $f