summaryrefslogtreecommitdiffstats
path: root/astyle/beautify_source_tree
blob: 0628a8e8db70d16e95bf4f8f8dd997f09c45b153 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

if [[ $1 == "" ]]; then
	echo "Please specify the source directory to beautify"
	exit 1
fi

ASTYLEARGS=$( cat <<EOF
--indent=tab                    \
--indent-classes                \
--indent-switches               \
--indent-cases                  \
--indent-namespaces             \
--indent-labels                 \
--indent-col1-comments          \
                                \
--unpad-paren                   \
                                \
--style=java                    \
--add-brackets                  \
--break-closing-brackets        \
--keep-one-line-statements
EOF
)

astyle $ASTYLEARGS --recursive $1/*.c   || true
astyle $ASTYLEARGS --recursive $1/*.cc  || true
astyle $ASTYLEARGS --recursive $1/*.cpp || true
astyle $ASTYLEARGS --recursive $1/*.h   || true