xref: /openbmc/linux/scripts/Lindent (revision fa70900e0984792cc45a9e51c28684c3287058c2)
11da177e4SLinus Torvalds#!/bin/sh
2ee8900c9SJoe PerchesPARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
3ee8900c9SJoe PerchesRES=`indent --version`
4*fa70900eSJean Delvareif [ "$RES" = "" ]; then
5*fa70900eSJean Delvare	exit 1
6*fa70900eSJean Delvarefi
7ee8900c9SJoe PerchesV1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1`
8ee8900c9SJoe PerchesV2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2`
9ee8900c9SJoe PerchesV3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3`
10ee8900c9SJoe Perchesif [ $V1 -gt 2 ]; then
11ee8900c9SJoe Perches  PARAM="$PARAM -il0"
12ee8900c9SJoe Percheselif [ $V1 -eq 2 ]; then
13ee8900c9SJoe Perches  if [ $V2 -gt 2 ]; then
14ee8900c9SJoe Perches    PARAM="$PARAM -il0";
15ee8900c9SJoe Perches  elif [ $V2 -eq 2 ]; then
16ee8900c9SJoe Perches    if [ $V3 -ge 10 ]; then
17ee8900c9SJoe Perches      PARAM="$PARAM -il0"
18ee8900c9SJoe Perches    fi
19ee8900c9SJoe Perches  fi
20ee8900c9SJoe Perchesfi
21ee8900c9SJoe Perchesindent $PARAM "$@"
22