mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
Added code formatting script.
This commit is contained in:
23
scripts/format_code.sh
Normal file
23
scripts/format_code.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/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
|
||||
|
||||
$ASTYLE --lineend=linux --mode=c --indent=force-tab=4 --brackets=linux \
|
||||
--indent-switches --indent-cases --indent-preprocessor \
|
||||
--indent-col1-comments --delete-empty-lines --break-closing-brackets \
|
||||
--break-elseifs --align-pointer=name --indent-labels --brackets=break \
|
||||
--unpad-paren $@
|
||||
exit $?
|
||||
Reference in New Issue
Block a user