lindent.sh 504 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0
  3. PARAM="-npro -kr -i4 -ts8 -sob -l132 -ss -ncs -cp1"
  4. RES=`indent --version | cut -d' ' -f3`
  5. if [ "$RES" = "" ]; then
  6. exit 1
  7. fi
  8. V1=`echo $RES | cut -d'.' -f1`
  9. V2=`echo $RES | cut -d'.' -f2`
  10. V3=`echo $RES | cut -d'.' -f3`
  11. if [ $V1 -gt 2 ]; then
  12. PARAM="$PARAM -il0"
  13. elif [ $V1 -eq 2 ]; then
  14. if [ $V2 -gt 2 ]; then
  15. PARAM="$PARAM -il0"
  16. elif [ $V2 -eq 2 ]; then
  17. if [ $V3 -ge 10 ]; then
  18. PARAM="$PARAM -il0"
  19. fi
  20. fi
  21. fi
  22. indent $PARAM "$@"