1#! /bin/sh
2
3## Unfortunately, indent doesn't do what I want, which is to respect spacing
4## after commas in function declarations.
5
6
7tmp_file="indent.tmp"
8
9if test -z "$1" -o -n "$2"; then
10    echo Usage: indent.sh filename
11    exit 1
12fi
13
14if test "$1" = "--help" -o "$1" = "-h"; then
15    echo Usage: indent.sh filename
16    exit 0
17fi
18
19if test ! -f "$1"; then
20    echo File \"$1\" not found
21    exit 1
22fi
23
24if test -f "$tmp_file"; then
25    echo Scratch file \"$tmp_file\" exists!  Please investigate.
26#    exit 1
27fi
28
29options="
30	    -nbad -bap -bbo -nbc -br -brs
31	    -c33 -cd33 -ncdb -ce -ci8 -cli0
32            -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l78 -lp
33	    -lc78 -npcs -nprs -npsl -nsc -nsob -nss -ts8 -v"
34
35
36indent -st $options $1 > $tmp_file
37