Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / tools / pgindent / pgcppindent
blob5ea0399bb4925cbbdcddf4e3985776996e50503f
1 #!/bin/sh
3 # $PostgreSQL$
5 trap "rm -f /tmp/$$ /tmp/$$a" 0 1 2 3 15
6 entab </dev/null >/dev/null
7 if [ "$?" -ne 0 ]
8 then echo "Go to the src/tools/entab directory and do a 'make' and 'make install'." >&2
9 echo "This will put the 'entab' command in your path." >&2
10 echo "Then run $0 again."
11 exit 1
13 astyle --version </dev/null >/dev/null 2>&1
14 if [ "$?" -eq 0 ]
15 then echo "You do not appear to have 'astyle' installed on your system." >&2
16 exit 1
19 for FILE
21 astyle --style=ansi -b -p -S < "$FILE" >/tmp/$$ 2>/tmp/$$a
22 if [ "$?" -ne 0 -o -s /tmp/$$a ]
23 then echo "$FILE"
24 cat /tmp/$$a
26 cat /tmp/$$ |
27 entab -t4 -qc |
28 cat >/tmp/$$a && cat /tmp/$$a >"$FILE"
29 done