#!/bin/sh
if [ -z $* ]
then
list=`find . -name "*.c"`
else
list=$*
fi
for file in $list
do
echo $file
dos2unix $file 2>/dev/null
indent -bl -bli0 -nce -nut -nbbo -nlp -l80 -kr -sob $file
chmod 777 $file
rm -f $file~
done
-bl: Put braces on line after if.
-bli0: Indent braces 0 spaces
-nce: Do not cuddle } and else
-nut: Use spaces instead of tabs
-nlp: Do not line up parentheses
-l80: Set maximum line length for non-comment lines to n.
-sob: swallow optional space lines