autogen.sh, ngindent, platformtest.sh: Fix warnings of "shellcheck"
[ngircd-alex.git] / contrib / ngindent
1 #!/bin/sh
2
3 INDENTARGS="-kr -i8 -ts8 -l80 -c3 -cd41 -ss -ncs -psl"
4
5 # check if indent(1) is available
6 command -v indent >/dev/null 2>&1 && INDENT="indent"
7 command -v gindent >/dev/null 2>&1 && INDENT="gindent"
8 command -v gnuindent >/dev/null 2>&1 && INDENT="gnuindent"
9
10 if [ -z "$INDENT" ]; then
11         echo "Error: GNU \"indent\" not found!"
12         exit 1
13 fi
14
15 $INDENT -v $INDENTARGS "$@"
16
17 # -eof-