3 # format_source.sh dirname - indent the whole source tree
4 # format_source.sh filename - indent a single file
7 #echo "Dir ${1} exists"
9 file_list=`find ${1} -name "*.cpp" -or -name "*.h" -type f`
10 for file2indent in $file_list
12 echo "Indenting file $file2indent"
14 uncrustify -f "$file2indent" -c "./format_source.cfg" -o indentoutput.tmp
15 mv indentoutput.tmp "$file2indent"
20 echo "Indenting one file $1"
22 uncrustify -f "$1" -c "./format_source.cfg" -o indentoutput.tmp
23 mv indentoutput.tmp "$1"
26 echo "ERROR: As parameter given directory or file does not exist!"
27 echo "Syntax is: format_source.sh dirname filesuffix"
28 echo "Syntax is: format_source.sh filename"
29 echo "Example: format_source.sh temp cpp"