CLANG-INCLUDE-FIXER(1)
π NAME π
clang-include-fixer β bestie, this is the manual page for clang-include-fixer 21, and it's literally the tool that fixes your includes for you so you don't have to go hunting through headers like it's a scavenger hunt. π
β¨ DESCRIPTION β¨
okay so first things first, here's how you actually run it:
USAGE: clang-include-fixer [options] <source0> [... <sourceN>]
OPTIONS: incoming, get comfy π«Ά
πΈ Generic Options πΈ
These are the main-character basics, the ones every LLVM tool shows up with π
--helpβ shows you all the available options. (psst,--help-hiddengives you even more π)--help-listβ prints a whole list of the available options. (and yeah,--help-list-hiddenfor the extra ones π)--versionβ tells you which version of this program you're running. iconic, brief, we love her β
π¦ Tool options π¦
This is where the actual magic happens, no cap β¨
--db=<value>β specify the input format. Your options are, and I quote:=fixedβ a hard-coded mapping π=yamlβ a Yaml database that was created byfind-all-symbols=fuzzyYamlβ a Yaml database, but with fuzzy-matched names π₯
--extra-arg=<string>β an extra argument that gets appended to the compiler command line--extra-arg-before=<string>β an extra argument that gets prepended to the compiler command line--input=<string>β a string used to initialize the database--insert-header=<string>β inserts one specific header. Heads up bestie, this one should run with STDIN mode. The result gets written to stdout, and it's currently used for editor integration. It supports YAML/JSON format, like this:
-insert-header="{
FilePath: "/path/to/foo.cc", QuerySymbolInfos: [
{RawIdentifier: foo,
Range: {Offset: 0, Length: 3}}
], HeaderInfos: [ {Headers: "\"foo_a.h\"",
QualifiedName: "a::foo"} ]}"
--minimize-pathsβ whether to minimize the added include paths π§--output-headersβ prints the symbol you're querying and all of its relevant headers in JSON format to stdout, like so:
{ "FilePath": "/path/to/foo.cc", "QuerySymbolInfos": [
{"RawIdentifier": "foo",
Range: {"Offset": 0, "Length": 3}}
], "HeaderInfos": [ {"Header": "\"foo_a.h\"",
"QualifiedName": "a::foo"} ]
}
-p <string>β build path-qβ reduce terminal output (the quiet, mysterious, lowkey one π€«)--query-symbol=<string>β query a given symbol (like"a::b::foo") directly in the database, without even parsing the file. so efficient of her π--stdinβ overrides the source file's content (in the overlaying virtual file system) with input from<stdin>, then runs the tool on that new content using the compilation options of the source file. This mode is currently used for editor integration π«Ά--style=<string>β fallback style for reformatting after inserting new headers, in case there's no clang-format config file to be found
and that's the whole page, bestie!! πβ¨ this little love letter comes to you as part of you guessed it, clang-include-fixer 21, dated September 2026 π now go forth and let the tool find your headers for you, periodt πππ
π¦ where this page comes from
- ubuntu stonking: clang-tools-21 1:21.1.8-10ubuntu2 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms