New script for generic formatting according Linux-CodingStyle

This commit is contained in:
Fritz Elfert 1997-02-03 23:49:40 +00:00
parent 8380ae243f
commit ccdfcb458d
1 changed files with 39 additions and 0 deletions

39
do_indent Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
BACKUP=false
if [ "$1" = "-b" ] ; then
BACKUP=true
shift
fi
formatiere() {
cp $1 $1\~
cat $1\~ | indent -kr -i8 -cli8 -psl -lp | \
sed -e 's/^ / /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/^\( \+\) /\1 /g' \
-e 's/[ ]\+$//g' > $1
if ! $BACKUP ; then
rm $1\~
fi
}
for f in $* ; do
formatiere $f
done