Skip to content

Commit

Permalink
scripts/Lindent: support gnu indent v2.2.10
Browse files Browse the repository at this point in the history
The new version of indent supports positioning labels in column 1
using "-il0"

http://www.nabble.com/Release-2.2.10-of-GNU-Indent-td15990700.html

Add "-il0" if indent version >= 2.2.10

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
JoePerches authored and torvalds committed Apr 29, 2008
1 parent 3a8ca95 commit ee8900c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion scripts/Lindent
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
#!/bin/sh
indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1 "$@"
PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
RES=`indent --version`
V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1`
V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2`
V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3`
if [ $V1 -gt 2 ]; then
PARAM="$PARAM -il0"
elif [ $V1 -eq 2 ]; then
if [ $V2 -gt 2 ]; then
PARAM="$PARAM -il0";
elif [ $V2 -eq 2 ]; then
if [ $V3 -ge 10 ]; then
PARAM="$PARAM -il0"
fi
fi
fi
indent $PARAM "$@"

0 comments on commit ee8900c

Please sign in to comment.