src/tools/pgindent/README
pgindent.pl will indent .c amd .h files according to the coding standards ofthe PostgreSQL project. It needs several things to run, and tries to locateor build them if possible. They can also be specified via command line switchesor the environment.
In its simplest form, if all the required objects are installed, simply runit without any parameters at the top of the source tree you want to process.
If you don't have all the requirements installed, pgindent will fetch and buildthem for you, if you're in a PostgreSQL source tree:
If your indent program is not installed in your path, you can specify itby setting the environment variable INDENT, or PGINDENT, or by giving thecommand line option --indent:
pgindent.pl --indent=/opt/extras/bsdindent
Similarly, the entab program can be specified using the PGENTAB environmentvariable, or using the --entab command line option.
pgindent.pl also needs a file containing a list of typedefs. This can bespecified using the PGTYPEDEFS environment variable, or via the command line--typedefs option. If neither is used, it will look for it within thecurrent source tree, or in /usr/local/etc/typedefs.list.
If you want to indent a source tree other than the current working directory,you can specify it via the --code-base command line option.
We don't want to indent certain files in the PostgreSQL source. pgindent.plwill honour a file containing a list of patterns of files to avoid. Thisfile can be specified using the --excludes command line option. If indentinga PostgreSQL source tree, this option isn't necessary, as it will find the filesrc/tools/pgindent/exclude_file_patterns.
Any non-option arguments are taken as the names of files to be indented. In thiscase only these files will be changed, and nothing else will be touched. If thefirst non-option argument is not a .c or .h file, it is treated as the nameof a typedefs file for legacy reasons, but this use is deprecated - use the--typedefs option instead.