CLANG-INCLUDE-FIXER(1)

πŸ“¦ version 12.0.1, in ubuntu jammy

πŸŽ€ 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-hidden gives you even more)
  • --help-list β€” prints the list of available options (and yeah, --help-list-hidden exists 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 by find-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 to stdout. 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 to stdout:
{
  "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 no clang-format config 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