Improve Astyle scripts to use variables.

Using variables for style and options makes it easier to edit the
scripts. Also avoids copy/paste errors when editing scripts.
This commit is contained in:
Kimmo Varis 2010-07-31 17:28:24 +03:00
parent 2fa4378338
commit 7b58455ff5
2 changed files with 25 additions and 18 deletions

View File

@ -1,13 +1,16 @@
#!/bin/bash #!/bin/bash
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren cli/*.cpp style="--style=ansi --min-conditional-indent=0"
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren cli/*.h options="--pad-header --unpad-paren"
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren gui/*.cpp
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren gui/*.h
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren lib/*.cpp
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren lib/*.h
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren test/*.cpp
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren test/*.h
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren tools/*.cpp astyle $style $options cli/*.cpp
astyle $style $options cli/*.h
astyle $style $options gui/*.cpp
astyle $style $options gui/*.h
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

View File

@ -1,12 +1,16 @@
REM A script to run Astyle for the sources
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren cli/*.cpp SET STYLE=--style=ansi --min-conditional-indent=0
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren cli/*.h SET OPTIONS=--pad-header --unpad-paren
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren gui/*.cpp
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren gui/*.h
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren lib/*.cpp
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren lib/*.h
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren test/*.cpp
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren test/*.h
astyle --style=ansi --min-conditional-indent=0 --pad-header --unpad-paren tools/*.cpp astyle %STYLE% %OPTIONS% cli/*.cpp
astyle %STYLE% %OPTIONS% cli/*.h
astyle %STYLE% %OPTIONS% gui/*.cpp
astyle %STYLE% %OPTIONS% gui/*.h
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