2014-05-23 15:07:07 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
ASTYLE=`which astyle`
|
|
|
|
|
|
|
|
if [ ! -x $ASTYLE ];
|
|
|
|
then
|
|
|
|
echo "No astyle found in path, please install."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $# -le 0 ]; then
|
|
|
|
echo "Usage:"
|
|
|
|
echo "\t$0 <file1> [<file2> ...]"
|
|
|
|
# echo "\t$0 -r <directory>"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2014-05-23 17:34:43 +04:00
|
|
|
$ASTYLE --lineend=linux --mode=c --indent=force-tab=4 --brackets=linux --pad-header \
|
2014-05-23 15:07:07 +04:00
|
|
|
--indent-switches --indent-cases --indent-preprocessor \
|
|
|
|
--indent-col1-comments --delete-empty-lines --break-closing-brackets \
|
2014-05-23 17:34:43 +04:00
|
|
|
--align-pointer=name --indent-labels --brackets=break \
|
2014-05-23 17:30:04 +04:00
|
|
|
--unpad-paren --break-blocks $@
|
2014-05-23 15:07:07 +04:00
|
|
|
exit $?
|