I use a combination of these switches to get code formatted to my liking:
#!/bin/sh
#
# Name: indent++
#
astyle \
--style=1tbs \
--indent=tab=4 \
--indent-switches \
--indent-preprocessor \
--convert-tabs \
--break-blocks \
--break-closing-brackets \
--unpad-paren \
--pad-header \
--pad-oper \
--pad-paren-out \
--add-brackets \
--align-pointer=type \
--align-reference=type < $file > $file.indented
mv $file $file.orig
mv $file.indented $file
No comments:
Post a Comment