CLANG-INCLUDE-FIXER(1)
π NAME π
clang-include-fixer β bestie, this is the manual page for clang-include-fixer 15 π¦
β¨ DESCRIPTION β¨
okay so here's the vibe. You run it like this:
USAGE: clang-include-fixer [options] <source0> [... <sourceN>]
and then there are OPTIONS. so many options. let's get into it π
πΈ Generic Options πΈ
--helpβ shows you all the available options (--help-hiddengets you even more, lowkey a lot)--help-listβ prints out the list of available options (--help-list-hiddenfor even more)--versionβ tells you what version of this program you're running
π Tool options π
--db=<value>β specify the input format. the options for value are:=fixedβ hard-coded mapping=yamlβ a Yaml database, the kind created byfind-all-symbols=fuzzyYamlβ a Yaml database, but with fuzzy-matched names
--extra-arg=<string>β an extra argument to append to the compiler command line--extra-arg-before=<string>β an extra argument to prepend to the compiler command line--input=<string>β a string to initialize the database with--insert-header=<string>β insert one specific header. this one should run with STDIN mode, bestie. the result gets written tostdout, and rn it's 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 plus all its relevant headers in JSON format tostdout, like this:
{ "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 (quiet girl era π)--query-symbol=<string>β query a given symbol (like"a::b::foo") directly in the database, no file parsing needed--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>β the fallback style for reformatting after inserting new headers, for when there's noclang-formatconfig file to be found
and that's the whole thing, no cap π this was clang-include-fixer 15, from July 2023, part of User Commands β go forth and let the includes fix themselves, you've got this π«Άβ¨
π¦ where this page comes from
- ubuntu jammy: clang-tools-15 1:15.0.7-0ubuntu0.22.04.3 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms