CLANG-INCLUDE-FIXER(1)
π NAME π
clang-include-fixer β okay bestie, this is the manual page for clang-include-fixer 12, and it's giving "let me add your missing #include for you" energy π
β¨ DESCRIPTION β¨
So here's the whole vibe β you run it like this:
USAGE: clang-include-fixer [options] <source0> [... <sourceN>]
Yep, that's the shape of it. Give it one or more source files, sprinkle some options on top, and it goes to work. π¦
π Generic Options π
These are the "works on literally every LLVM tool" classics, no cap:
--helpβ shows you all the available options (and if you want the secret menu,--help-hiddengives you even more)--help-listβ prints the list of available options (and yeah,--help-list-hiddenexists for the extra ones)--versionβ tells you what version of this program you're on
π§ Tool options π§
This is the main character section. Every single one, right here:
--db=<value>β specifies the input format. It comes in three flavors:=fixedβ a hard-coded mapping=yamlβ a YAML database created byfind-all-symbols=fuzzyYamlβ a YAML database, but with fuzzy-matched names β¨
--extra-arg=<string>β an additional argument to append to the compiler command line--extra-arg-before=<string>β an additional argument to prepend to the compiler command line--input=<string>β a string used to initialize the database--insert-header=<string>β insert one specific header. Heads up: this one should run in STDIN mode, and the result gets written tostdout. It's currently used for editor integration. It supports YAML/JSON format:
-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 being queried and all its relevant headers in JSON format tostdout:
{
"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β reduces terminal output (the quiet, lowkey setting π€«)--query-symbol=<string>β query a given symbol (like"a::b::foo") directly in the database, without parsing the file. So efficient.--stdinβ overrides the source file's content (in the overlaying virtual file system) with input from<stdin>, then runs the tool on the new content using the compilation options of the source file. This mode is currently used for editor integration. π«Ά--style=<string>β the fallback style used for reformatting after inserting new headers, for when there's noclang-formatconfig file to be found
Not me ending the page without a single extra tip β everything above is exactly what's in the original, fr fr. π
That's the whole thing, bestie. Go forth and never hand-write an #include again. π
clang-include-fixer 12 β February 2022 π¦ that's the source, version and date, and yes she ate π
β¨
π¦ where this page comes from
- ubuntu jammy: clang-tools-12 1:12.0.1-19ubuntu3 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms