2009-01-05 16:52:02 +01:00
|
|
|
#!/bin/bash
|
2011-06-22 13:20:36 +02:00
|
|
|
# The version check in this script is used to avoid commit battles
|
|
|
|
# between different developers that use different astyle versions as
|
|
|
|
# different versions might have different output (this has happened in
|
|
|
|
# the past).
|
|
|
|
|
|
|
|
# If project management wishes to take a newer astyle version into use
|
2011-06-22 20:41:14 +02:00
|
|
|
# just change this string to match the start of astyle version string.
|
|
|
|
ASTYLE_VERSION="Artistic Style Version 2."
|
2011-06-22 13:20:36 +02:00
|
|
|
|
2011-06-22 20:41:14 +02:00
|
|
|
if [[ "`astyle --version 2>&1`" != ${ASTYLE_VERSION}* ]]; then
|
2011-02-11 22:37:38 +01:00
|
|
|
echo "You should use: ${ASTYLE_VERSION}";
|
|
|
|
exit 1;
|
|
|
|
fi
|
2009-01-05 16:52:02 +01:00
|
|
|
|
2011-02-09 13:13:37 +01:00
|
|
|
style="--style=ansi --lineend=linux --min-conditional-indent=0"
|
2010-09-19 08:25:17 +02:00
|
|
|
options="--pad-header --unpad-paren --suffix=none"
|
2010-07-31 16:28:24 +02:00
|
|
|
|
|
|
|
astyle $style $options cli/*.cpp
|
|
|
|
astyle $style $options cli/*.h
|
|
|
|
astyle $style $options gui/*.cpp
|
|
|
|
astyle $style $options gui/*.h
|
2011-06-10 13:20:43 +02:00
|
|
|
astyle $style $options -r gui/test/*.cpp
|
|
|
|
astyle $style $options -r gui/test/*.h
|
2010-07-31 16:28:24 +02:00
|
|
|
astyle $style $options lib/*.cpp
|
|
|
|
astyle $style $options lib/*.h
|
|
|
|
astyle $style $options test/*.cpp
|
|
|
|
astyle $style $options test/*.h
|
|
|
|
|
|
|
|
astyle $style $options tools/*.cpp
|
2009-01-08 07:23:21 +01:00
|
|
|
|