blob: bca4c58dd18d48b77446192ba48d55540399bba0 [file] [log] [blame]
.TH UNCRUSTIFY "1" "Oct 2014" "uncrustify @PACKAGE_VERSION@" "User Commands"
.SH NAME
uncrustify \- C, C++, C#, D, Java and Pawn source code beautifier
.SH SYNOPSIS
.B uncrustify \fR[\fIOPTIONS\fR] [\fIFILES\fR]
.SH DESCRIPTION
If no input files are specified, the input is read from stdin.
.br
If reading from stdin, you should specify the language using \-l.
If \-F is used or files are specified on the command line, the output filename is
\fIPFX\fR + "/" + filename + \fISFX\fR.
.br
Unless, of course, the options \fB\-\-replace\fR or \fB\-\-no\-backup\fR are used.
When reading from stdin or doing a single file via the '\-f' option,
the output is dumped to stdout, unless redirected with \-o FILE.
Errors are always dumped to stderr
.SH OPTIONS
.SS "Basic Options:"
.TP
\fB\-c\fI CFG
Use the config file \fICFG\fR.
.br
If not specified, uncrustify will use \fB$UNCRUSTIFY_CONFIG\fR or \fB$HOME\\.uncrustify.cfg\fR.
.TP
\fB\-f\fI FILE
Process the single file \fIFILE\fR, sending output to stdout or the file specified with \fB\-o\fR.
.TP
\fB\-o\fI FILE
Redirect output to \fIFILE\fR.
.br
Use with \fB\-f\fR, \fB\-\-update\-config\fR, \fB\-\-update\-config\-with\-doc\fR,
\fB\-\-universalindent\fR.
.TP
\fB\-\-check\fR
Do not output the new text, instead verify that nothing changes when
the file(s) are processed. The status of every file is printed to
stderr. The exit code is EXIT_SUCCESS if there were no changes, EXIT_FAILURE otherwise.
.TP
\fB\-F\fI FILE
Read files to process from \fIFILE\fR, one filename per line. If \fIFILE\fR
is \'\-\' then read filenames from standard input instead of a file.
.br
You can create this file using something like \'\fBfind . \-name "*.c" > list.txt\fR\'.
.br
This cannot be combined with \fB\-f\fR.
.TP
\fB\-\-prefix\fI PFX
Prepend \fIPFX\fR to the output filename path.
.br
This cannot be combined with \fB\-f\fR, \fB\-\-replace\fR, or \fB\-\-no\-backup\fR.
.TP
\fB\-\-suffix\fI SFX
Append \fISFX\fR to the output filename.
.br
The default is '.uncrustify' if neither \fISFX\fR or \fIPFX\fR are specified.
.br
This cannot be combined with \fB\-f\fR, \fB\-\-replace\fR, or \fB\-\-no\-backup\fR.
.TP
\fB\-\-frag\fI
Assume the input is a code fragment and the first line is properly indented.
.TP
\fB\-\-replace\fR
Replace source files (creates a backup).
.br
This cannot be combined with \fB\-f\fR, \fB\-\-prefix\fR, or \fB\-\-suffix\fR.
.TP
\fB\-\-no\-backup\fR
Replace files, no backup. Useful if files are under source control
.br
This cannot be combined with \fB\-f\fR, \fB\-\-prefix\fR, or \fB\-\-suffix\fR.
.TP
\fB\-\-mtime\fR
Preserve mtime on replaced files.
.TP
\fB\-l\fR
Language override: C, CPP, D, CS, JAVA, PAWN, VALA, OC, OC+
.TP
\fB\-t\fR
Load a file with types (usually not needed)
.TP
\fB\-q\fR
Quiet mode \- no output on stderr (\fB\-L\fR will override)
.SS "Config/Help Options:"
.TP
\fB\-h\fR \-? \fB\-\-help\fR \fB\-\-usage\fR
Print this message and exit
.TP
\fB\-\-version\fR
Print the version and exit
.TP
\fB\-\-show\-config\fR
Print out option documentation and exit
.TP
\fB\-\-update\-config\fR
Output a new config file.
.TP
\fB\-\-update\-config\-with\-doc\fR
Output a new config file with embedded usage comments.
.TP
\fB\-\-universalindent\fR
Output a config file for Universal Indent GUI.
.TP
\fB\-\-detect\fR
Detects the config from a source file. Use with '\-f FILE'.
Detection is currently fairly limited.
.SS "Debug Options:"
.TP
\fB\-p\fI FILE
Dump debug info to a file
.TP
\fB\-L\fI SEV
Set the log severity (see log_levels.h)
.TP
\fB\-s\fR
Show the log severity in the logs
.TP
\fB\-\-decode\fI FLAG
Print \fIFLAG\fR as text and exit
.SH EXAMPLES
.TP
Read a D file from stdin, output to stdout.
cat foo.d | uncrustify \-q \-c my.cfg \-l d
.TP
Process a file, output to stdout.
uncrustify \-c my.cfg \-d foo.d
.TP
Process a source tree, output to a different tree.
find src \-name "*.[ch]" > files.txt
.br
uncrustify \-c my.cfg \-F files.txt \-\-prefix out
.TP
Process a source tree in\(hyplace.
uncrustify \-c my.cfg \-\-no\-backup $(find src \-name "*.[ch]")
.SH NOTES
Use comments containing ' *INDENT\-OFF*' and ' *INDENT\-ON*' to disable
processing of parts of the source file.
.SH AUTHOR
Written by Ben Gardner
.SH REPORTING BUGS
Use the issue tracker at <http://sourceforge.net/projects/uncrustify>
.SH COPYRIGHT
Copyright (C) 2006\(hy2014 Ben Gardner
.SH LICENSE
GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.