summaryrefslogtreecommitdiff
path: root/README.pg_bsd_indent
blob: 247c45df9d7a27a825b9325d03c6867ec0e64f53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pg_bsd_indent

Please note that this git repo is OBSOLETE as of Feb. 2023.
pg_bsd_indent has been absorbed into the main Postgres source tree
(under src/tools/pg_bsd_indent) and is now maintained there.

----------

This is a lightly modified version of the "indent" program maintained
by the FreeBSD project.  The modifications are mostly to make it portable
to non-BSD-ish platforms, though we do have one formatting switch we
couldn't convince upstream to take.

To build it, you will need a Postgres installation, version 9.5 or newer.
(Once built, the program doesn't depend on that installation.)

To build, just say "make"; or if pg_config from your Postgres installation
isn't in your PATH, say
	make PG_CONFIG=path/to/pg_config
Optionally, run "make test" for some simple sanity checks.

To install, copy pg_bsd_indent to somewhere in your usual PATH.
(If you say "make install", it will try to put it in your Postgres
installation directory, which is most likely not what you want for
long-term use.)

TODO: add build support and instructions for Windows


If you happen to be hacking upon the indent source code, the closest
approximation to the existing indentation style seems to be

	./pg_bsd_indent -i4 -l79 -di12 -nfc1 -nlp -sac somefile.c

although this has by no means been rigorously adhered to.
(What was that saw about the shoemaker's children?)