CLANG-INCLUDE-FIXER(1)

πŸ“¦
version 20.1.8 Β· 4 versions
, in ubuntu stonking

πŸ’– CLANG-INCLUDE-FIXER πŸ’–

okay so bestie, meet clang-include-fixer β€” it's the User Commands girlie from the CLANG-INCLUDE-FIXER(1) man page, and she's here to fix your includes. periodt.


✨ DESCRIPTION ✨

The vibe check first, the whole usage in one glorious line:

USAGE: clang-include-fixer [options] <source0> [... <sourceN>]

Then it says, very iconically:

OPTIONS:


🌈 Generic Options 🌈

These are the standard-issue ones every cool tool gets, no cap:

  • --help β€” shows you all the available options. and if you want the secret menu, add --help-hidden for more πŸ’…
  • --help-list β€” prints the list of available options. same deal: --help-list-hidden gives you more πŸ‘‘
  • --version β€” tells you which version of this program you're running. slay.

πŸŽ€ Tool options πŸŽ€

the main character section, fr fr:

  • --db=<value> β€” picks your input format. the options are:
    • =fixed β€” a hard-coded mapping πŸ”₯
    • =yaml β€” a YAML database, as created by find-all-symbols
    • =fuzzyYaml β€” a YAML database, but with fuzzy-matched names ✨
  • --extra-arg=<string> β€” one more argument to append to the compiler command line 🫢
  • --extra-arg-before=<string> β€” one more argument to prepend to the compiler command line (yes, before. order matters bestie)
  • --input=<string> β€” a string used to initialize the database
  • --insert-header=<string> β€” inserts a specific header. 🚨 this one has to run in STDIN mode. the result goes 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. lowkey tidy ✨
  • --output-headers β€” prints the symbol being queried and all its relevant headers as JSON to stdout. it's giving very readable:
{
  "FilePath": "/path/to/foo.cc", "QuerySymbolInfos": [
  {"RawIdentifier": "foo",
      "Range": {"Offset": 0, "Length": 3}}
  ],     "HeaderInfos": [ {"Header": "\"foo_a.h\"",
      "QualifiedName": "a::foo"} ]
}
  • -p <string> β€” the build path πŸ› οΈ
  • -q β€” reduces terminal output. quiet queen energy πŸ’€
  • --query-symbol=<string> β€” queries a given symbol (like "a::b::foo") in the database directly, 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 that 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, in case there's no clang-format config file found 🌸

πŸ’– reminder bestie: the STDIN modes (--insert-header especially) are the ones your editor is probably calling behind your back. that's not a bug, that's a feature.

and that's the whole page, literally. this was clang-include-fixer 20, dated September 2026 πŸ’œ go fix those includes, you absolute icon πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from