1pgindent will indent .c and .h files according to the coding standards of 2the PostgreSQL project. It needs several things to run, and tries to locate 3or build them if possible. They can also be specified via command line switches 4or the environment. 5 6In its simplest form, if all the required objects are installed, simply run 7it without any parameters at the top of the source tree you want to process. 8 9 pgindent 10 11If you don't have all the requirements installed, pgindent will fetch and build 12them for you, if you're in a PostgreSQL source tree: 13 14 pgindent --build 15 16If your pg_bsd_indent program is not installed in your path, you can specify 17it by setting the environment variable INDENT, or PGINDENT, or by giving the 18command line option --indent: 19 20 pgindent --indent=/opt/extras/bsdindent 21 22pgindent also needs a file containing a list of typedefs. This can be 23specified using the PGTYPEDEFS environment variable, or via the command line 24--typedefs option. If neither is used, it will look for it within the 25current source tree, or in /usr/local/etc/typedefs.list. 26 27If you want to indent a source tree other than the current working directory, 28you can specify it via the --code-base command line option. 29 30We don't want to indent certain files in the PostgreSQL source. pgindent 31will honor a file containing a list of patterns of files to avoid. This 32file can be specified using the --excludes command line option. If indenting 33a PostgreSQL source tree, this option isn't necessary, as it will find the file 34src/tools/pgindent/exclude_file_patterns. 35 36Any non-option arguments are taken as the names of files to be indented. In this 37case only these files will be changed, and nothing else will be touched. If the 38first non-option argument is not a .c or .h file, it is treated as the name 39of a typedefs file for legacy reasons, but this use is deprecated - use the 40--typedefs option instead. 41