UNCRUSTIFY(1)
πΈ NAME πΈ
okay so bestie, welcome to the uncrustify manual page β section 1, User Commands, and it's literally a C, C++, C#, D, Java and Pawn source code beautifier π
β¨. yes she does all of those. no cap.
π SYNOPSIS π
uncrustify [OPTIONS] [FILES]
that's it. that's the whole vibe. π¦
π DESCRIPTION π
so here's the tea, bestie β:
- If you don't hand her any input files, she reads the input from
stdin. π - And if you're reading from
stdin, you should tell her the language using-l. fr fr, she needs to know. - If
-Fis used, or if files are just chillin' on the command line, the output filename isPFX + "/" + filename + SFX. That's the formula, periodt.- unless of course the options
--replaceor--no-backupare used. then it's a whole different story.
- unless of course the options
- When reading from
stdinor doing a single file via the'-f'option, the output is dumped tostdout, unless you redirect it with-o FILE. π - Errors are always dumped to
stderr. every single time. no exceptions. π
β¨ OPTIONS β¨
π Basic Options:
-c CFGβ use the config fileCFG, or defaults ifCFGis set to'-'. If you don't specify it, uncrustify will use$UNCRUSTIFY_CONFIGor$HOME/.uncrustify.cfg. she'll find it, don't worry π«Ά-f FILEβ process the single fileFILE, sending output tostdoutor the file you picked with-o. one file, one moment, main character energy π-o FILEβ redirect output toFILE. use this with-f,--update-config,--update-config-with-doc,--universalindent. those are her besties for this one.--checkβ do not output the new text, instead verify that nothing changes when the file(s) are processed. the status of every file is printed tostderr. the exit code isEXIT_SUCCESSif there were no changes,EXIT_FAILUREotherwise. it's giving "vibe check but for your formatting" β¨-F FILEβ read files to process fromFILE, one filename per line. ifFILEisΒ΄-Β΄then read filenames from standard input instead of a file. you can create this file using something likeΒ΄find . -name "*.c" > list.txtΒ΄. π- this cannot be combined with
-f. nope. not happening.
- this cannot be combined with
--prefix PFXβ prependPFXto the output filename path.- this cannot be combined with
-f,--replace, or--no-backup.
- this cannot be combined with
--suffix SFXβ appendSFXto the output filename.- the default is
'.uncrustify'if neitherSFXorPFXare specified. - this cannot be combined with
-f,--replace, or--no-backup.
- the default is
--fragβ assume the input is a code fragment and the first line is properly indented. little snippet treatment, we love her π§--replaceβ replace source files (creates a backup). she's bold but she's careful π- this cannot be combined with
-f,--prefix, or--suffix.
- this cannot be combined with
--no-backupβ replace files, no backup. useful if files are under source control. no backup bestie, she said what she said π- this cannot be combined with
-f,--prefix, or--suffix.
- this cannot be combined with
--if-changedβ write tostdout(or create outputFILE) only if a change was detected. no change, no noise. iconic. π₯--mtimeβ preservemtimeon replaced files. her timestamps stay untouched, as they should. β-lβ language override:C,CPP,D,CS,JAVA,PAWN,VALA,OC,OC+-tβ load a file with types (usually not needed). lowkey optional.-qβ quiet mode β no output onstderr(-Lwill override). shhh π€«
π Config/Help Options:
-h,-?,--help,--usageβ print this message and exit. she's helping, she's humble π«Ά--versionβ print the version and exit.--count-optionsβ print the number of available options and exit. yes, she counted. all of them. π--show-configβ print out option documentation and exit.--update-configβ output a new config file.--update-config-with-docβ output a new config file with embedded usage comments.--universalindentβ output a config file for Universal Indent GUI.--detectβ detects the config from a source file. use with'-f FILE'. detection is currently fairly limited, so manage your expectations bestie π--tracking space:FILEβ prepare space tracking information for debugging.--tracking nl:FILEβ prepare newline tracking information for debugging.--tracking start:FILEβ prepare start of statement tracking information for debugging.- cannot be used with the
-ooption.
- cannot be used with the
π₯ Debug Options:
-p FILEβ dump debug info intoFILE, or tostdoutifFILEis set to'-'.- must be used in combination with
'-f FILE'.
- must be used in combination with
-ds FILE,--dump-steps FILEβ dump parsing info at various moments of the formatting process.- this creates a series of files named
'FILE_nnn.log', each corresponding to a formatting step in uncrustify. π - the file
'FILE_000.log'lists the formatting options in use. - must be used in combination with
'-f FILE'.
- this creates a series of files named
-L SEVβ set the log severity (seelog_levels.h).-sβ show the log severity in the logs.--decode FLAGβ printFLAGas text and exit.
π EXAMPLES π
Read a D file from stdin, output to stdout.
cat foo.d | uncrustify -q -c my.cfg -l d
Process a file, output to stdout.
uncrustify -c my.cfg -d foo.d
Process a source tree, output to a different tree.
find src -name "*.[ch]" > files.txt
uncrustify -c my.cfg -F files.txt --prefix out
Process a source tree in-place.
uncrustify -c my.cfg --no-backup $(find src -name "*.[ch]")
β NOTES β
use comments containing ' *INDENT-OFF*' and ' *INDENT-ON*' to disable processing of parts of the source file. like a little "do not disturb" sign for your code π iykyk.
π AUTHOR π
Written by Ben Gardner. we stan. π
π¦ REPORTING BUGS π¦
use the issue tracker at <http://sourceforge.net/projects/uncrustify>. she wants to hear from you, fr fr.
πΈ COPYRIGHT πΈ
- Copyright (C) 2006β2014 Ben Gardner
- Copyright (C) 2015, 2016 Guy Maurel
π 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. read that again bestie, NO warranty, she's honest about it π
and that's the whole page π«Ά this was uncrustify β page for section 1 of the manual, dated Oct 2014, version vibes included β go format something gorgeous, mwah πβ¨πΈ
π¦ where this page comes from
- alpine 3.24: uncrustify-doc 0.83.0-r0 Β· GPL-2.0-or-later
- arch rolling: uncrustify 0.83.0-1 Β· GPL-2.0-only
- fedora 43: uncrustify 0.81.0-2.fc43 Β· GPL-2.0-or-later
- fedora 44: uncrustify 0.82.0-2.fc44 Β· GPL-2.0-or-later
- nixos 26.05: uncrustify 0.83.0
- nixpkgs unstable: uncrustify 0.83.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms