CLANG-INCLUDE-FIXER(1)

πŸ“¦ version 11.1.0, in ubuntu jammy

✨ NAME ✨

clang-include-fixer β€” bestie, this is the manual page for clang-include-fixer 11, section 1, User Commands. It fixes your includes. It's giving "I will find the header you forgot" energy. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's how you actually run this thing:

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

That's it. You hand it your source files and it does its little magic. Periodt. 🌈


πŸŽ€ OPTIONS πŸŽ€

✨ Generic Options ✨

The universal ones, the classics, the ones every LLVM tool shows up with:

  • --help β€” Display available options. And if you want the secret menu, pass --help-hidden for more. πŸ™ˆ
  • --help-list β€” Display list of available options (--help-list-hidden for more).
  • --version β€” Display the version of this program.

πŸ’– Tool options πŸ’–

This is the main character section. Pull up a chair.

  • --db=<value> β€” Specify input format. Pick your flavor, bestie:
    • =fixed β€” Hard-coded mapping. Zero thoughts, just vibes.
    • =yaml β€” Yaml database created by find-all-symbols.
    • =fuzzyYaml β€” Yaml database, with fuzzy-matched names. (Fuzzy! Like a little peach πŸ‘ that doesn't need exact names.)
  • --extra-arg=<string> β€” Additional argument to append to the compiler command line.
  • --extra-arg-before=<string> β€” Additional argument to prepend to the compiler command line. (Yes, before. Not the same as above, don't @ me.)
  • --input=<string> β€” String to initialize the database.
  • --insert-header=<string> β€” Insert a specific header. This should run with STDIN mode. The result is written to stdout. It is currently used for editor integration. Support 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 added include paths.
  • --output-headers β€” Print 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 β€” Reduce terminal output. (Shy queen behavior, honestly. 🀫)
  • --query-symbol=<string> β€” Query a given symbol (e.g. "a::b::foo") in database directly without parsing the file. So efficient of it.
  • --stdin β€” Override source file's content (in the overlaying virtual file system) with input from <stdin> and run the tool on the new content with 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 if there is no clang-format config file found.

Heads up bestie 🫢 β€” --insert-header is meant to run with STDIN mode, and both --insert-header and --output-headers write to stdout, so plan your redirections accordingly. No cap.

Okay that's the whole page, go slay some includes, this was clang-include-fixer 11 from January 2022, mwah πŸ’‹βœ¨πŸ¦‹

πŸ“¦ where this page comes from