1UNCRUSTIFY(1)                    User Commands                   UNCRUSTIFY(1)
2
3
4

NAME

6       uncrustify - C, C++, C#, D, Java and Pawn source code beautifier
7
8

SYNOPSIS

10       uncrustify [OPTIONS] [FILES]
11
12

DESCRIPTION

14       If no input files are specified, the input is read from stdin.
15       If reading from stdin, you should specify the language using -l.
16
17       If  -F  is  used or files are specified on the command line, the output
18       filename is PFX + "/" + filename + SFX.
19       Unless, of course, the options --replace or --no-backup are used.
20
21       When reading from stdin or doing a single file via the '-f' option, the
22       output is dumped to stdout, unless redirected with -o FILE.
23
24       Errors are always dumped to stderr
25
26

OPTIONS

28   Basic Options:
29       -c CFG Use the config file CFG, or defaults if CFG is set to '-'.
30              If  not  specified,  uncrustify  will  use $UNCRUSTIFY_CONFIG or
31              $HOME/.uncrustify.cfg.
32
33       -f FILE
34              Process the single file FILE, sending output to  stdout  or  the
35              file specified with -o.
36
37       -o FILE
38              Redirect output to FILE.
39              Use  with  -f, --update-config, --update-config-with-doc, --uni‐
40              versalindent.
41
42       --check
43              Do not output the new text, instead verify that nothing  changes
44              when  the  file(s)  are  processed.  The status of every file is
45              printed to stderr. The exit code is EXIT_SUCCESS if  there  were
46              no changes, EXIT_FAILURE otherwise.
47
48       -F FILE
49              Read files to process from FILE, one filename per line.  If FILE
50              is ´-´ then read filenames from  standard  input  instead  of  a
51              file.
52              You  can  create  this  file  using something like ´find . -name
53              "*.c" > list.txt´.
54              This cannot be combined with -f.
55
56       --prefix PFX
57              Prepend PFX to the output filename path.
58              This cannot be combined with -f, --replace, or --no-backup.
59
60       --suffix SFX
61              Append SFX to the output filename.
62              The default is '.uncrustify' if neither SFX or  PFX  are  speci‐
63              fied.
64              This cannot be combined with -f, --replace, or --no-backup.
65
66       --frag Assume  the input is a code fragment and the first line is prop‐
67              erly indented.
68
69       --replace
70              Replace source files (creates a backup).
71              This cannot be combined with -f, --prefix, or --suffix.
72
73       --no-backup
74              Replace files, no backup. Useful if files are under source  con‐
75              trol
76              This cannot be combined with -f, --prefix, or --suffix.
77
78       --mtime
79              Preserve mtime on replaced files.
80
81       -l     Language override: C, CPP, D, CS, JAVA, PAWN, VALA, OC, OC+
82
83       -t     Load a file with types (usually not needed)
84
85       -q     Quiet mode - no output on stderr (-L will override)
86
87   Config/Help Options:
88       -h -? --help --usage
89              Print this message and exit
90
91       --version
92              Print the version and exit
93
94       --count-options
95              Print the number of available options and exit
96
97       --show-config
98              Print out option documentation and exit
99
100       --update-config
101              Output a new config file.
102
103       --update-config-with-doc
104              Output a new config file with embedded usage comments.
105
106       --universalindent
107              Output a config file for Universal Indent GUI.
108
109       --detect
110              Detects  the  config  from  a  source  file. Use with '-f FILE'.
111              Detection is currently fairly limited.
112
113
114   Debug Options:
115       -p FILE
116              Dump debug info into FILE, or to stdout if FILE is set to '-'."
117              Must be used in combination with '-f FILE'."
118
119       -L SEV Set the log severity (see log_levels.h)
120
121       -s     Show the log severity in the logs
122
123       --decode FLAG
124              Print FLAG as text and exit
125
126

EXAMPLES

128       Read a D file from stdin, output to stdout.
129              cat foo.d | uncrustify -q -c my.cfg -l d
130
131       Process a file, output to stdout.
132              uncrustify -c my.cfg -d foo.d
133
134       Process a source tree, output to a different tree.
135              find src -name "*.[ch]" > files.txt
136              uncrustify -c my.cfg -F files.txt --prefix out
137
138       Process a source tree in‐place.
139              uncrustify -c my.cfg --no-backup $(find src -name "*.[ch]")
140
141

NOTES

143       Use comments containing ' *INDENT-OFF*' and ' *INDENT-ON*'  to  disable
144       processing of parts of the source file.
145
146

AUTHOR

148       Written by Ben Gardner
149
150

REPORTING BUGS

152       Use the issue tracker at <http://sourceforge.net/projects/uncrustify>
153
154
156       Copyright (C) 2006‐2014 Ben Gardner
157       Copyright (C) 2015, 2016 Guy Maurel
158
159

LICENSE

161       GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
162
163       This is free software; see the source for copying conditions.  There is
164       NO warranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR
165       PURPOSE.
166
167
168
169
170uncrustify                         Oct 2014                      UNCRUSTIFY(1)
Impressum