CLANG-INCLUDE-FIXER(1)

πŸ“¦
version 21.1.8 Β· 3 versions
, in ubuntu stonking

πŸ’– 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-hidden gives you even more πŸ‘€)
  • --help-list β€” prints a whole list of the available options. (and yeah, --help-list-hidden for 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 by find-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