xref: /openbmc/linux/scripts/Lindent (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
11da177e4SLinus Torvalds#!/bin/sh
2*b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
378c52502SJean Delvare
4ee8900c9SJoe PerchesPARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1"
578c52502SJean Delvare
678c52502SJean DelvareRES=`indent --version | cut -d' ' -f3`
7fa70900eSJean Delvareif [ "$RES" = "" ]; then
8fa70900eSJean Delvare	exit 1
9fa70900eSJean Delvarefi
1078c52502SJean DelvareV1=`echo $RES | cut -d'.' -f1`
1178c52502SJean DelvareV2=`echo $RES | cut -d'.' -f2`
1278c52502SJean DelvareV3=`echo $RES | cut -d'.' -f3`
1378c52502SJean Delvare
14ee8900c9SJoe Perchesif [ $V1 -gt 2 ]; then
15ee8900c9SJoe Perches  PARAM="$PARAM -il0"
16ee8900c9SJoe Percheselif [ $V1 -eq 2 ]; then
17ee8900c9SJoe Perches  if [ $V2 -gt 2 ]; then
1878c52502SJean Delvare    PARAM="$PARAM -il0"
19ee8900c9SJoe Perches  elif [ $V2 -eq 2 ]; then
20ee8900c9SJoe Perches    if [ $V3 -ge 10 ]; then
21ee8900c9SJoe Perches      PARAM="$PARAM -il0"
22ee8900c9SJoe Perches    fi
23ee8900c9SJoe Perches  fi
24ee8900c9SJoe Perchesfi
2578c52502SJean Delvare
26ee8900c9SJoe Perchesindent $PARAM "$@"
27