Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #!/bin/sh |
Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 2 | # SPDX-License-Identifier: GPL-2.0 |
Jean Delvare | 78c5250 | 2017-02-22 15:40:20 -0800 | [diff] [blame] | 3 | |
Joe Perches | ee8900c | 2008-04-29 00:59:31 -0700 | [diff] [blame] | 4 | PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" |
Jean Delvare | 78c5250 | 2017-02-22 15:40:20 -0800 | [diff] [blame] | 5 | |
| 6 | RES=`indent --version | cut -d' ' -f3` |
Jean Delvare | fa70900 | 2015-09-04 15:43:24 -0700 | [diff] [blame] | 7 | if [ "$RES" = "" ]; then |
| 8 | exit 1 |
| 9 | fi |
Jean Delvare | 78c5250 | 2017-02-22 15:40:20 -0800 | [diff] [blame] | 10 | V1=`echo $RES | cut -d'.' -f1` |
| 11 | V2=`echo $RES | cut -d'.' -f2` |
| 12 | V3=`echo $RES | cut -d'.' -f3` |
| 13 | |
Joe Perches | ee8900c | 2008-04-29 00:59:31 -0700 | [diff] [blame] | 14 | if [ $V1 -gt 2 ]; then |
| 15 | PARAM="$PARAM -il0" |
| 16 | elif [ $V1 -eq 2 ]; then |
| 17 | if [ $V2 -gt 2 ]; then |
Jean Delvare | 78c5250 | 2017-02-22 15:40:20 -0800 | [diff] [blame] | 18 | PARAM="$PARAM -il0" |
Joe Perches | ee8900c | 2008-04-29 00:59:31 -0700 | [diff] [blame] | 19 | elif [ $V2 -eq 2 ]; then |
| 20 | if [ $V3 -ge 10 ]; then |
| 21 | PARAM="$PARAM -il0" |
| 22 | fi |
| 23 | fi |
| 24 | fi |
Jean Delvare | 78c5250 | 2017-02-22 15:40:20 -0800 | [diff] [blame] | 25 | |
Joe Perches | ee8900c | 2008-04-29 00:59:31 -0700 | [diff] [blame] | 26 | indent $PARAM "$@" |