CLANG-INCLUDE-FIXER(1)

πŸ“¦
version 16.0.6 Β· 2 versions
, in debian bookworm

✨ NAME ✨

okay bestie, welcome to the clang-include-fixer glow-up πŸ’– β€” this is the manual page for clang-include-fixer 16, and it lives in the User Commands section of the manual (section 1). it's the little tool that goes and finds the #include you forgot, like a friend who texts you "you left your keys on the counter" but for C++ 🫢


🌸 DESCRIPTION 🌸

USAGE, and yes this is the whole vibe:

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

OPTIONS: β€” buckle up, there's a lot, and we're doing all of them, no skips πŸ’…

πŸŽ€ Generic Options πŸŽ€

these ones come free with basically every LLVM tool, they're the base-layer fit that goes with everything.

  • --help β€” Display available options (--help-hidden for more). the classic "help me pls" button, and if you want the deep lore version, there's --help-hidden.
  • --help-list β€” Display list of available options (--help-list-hidden for more). a cute little list, and again, the hidden variant exists if you're nosy (respectfully).
  • --version β€” Display the version of this program. so you can confirm you're on the right build, bestie, no guessing.

πŸ¦‹ Tool options πŸ¦‹

this is the main character section. the actual lore. πŸ‘‘

  • --db=<value> β€” Specify input format. and the possible values are:
    • =fixed β€” Hard-coded mapping. built in, no external files, it just knows.
    • =yaml β€” Yaml database created by find-all-symbols. you went and generated it yourself, iconic.
    • =fuzzyYaml β€” Yaml database, with fuzzy-matched names. same energy as yaml but the matching is vibes-based (fuzzy), lowkey forgiving.
  • --extra-arg=<string> β€” Additional argument to append to the compiler command line. appending it at the end, bestie. the caboose.
  • --extra-arg-before=<string> β€” Additional argument to prepend to the compiler command line. and this one goes at the front, first in line, main character.
  • --input=<string> β€” String to initialize the database. you feed it a string, it wakes the database up. that's it, that's the whole thing.
  • --insert-header=<string> β€” Insert a specific header. This should run with STDIN mode. πŸ‘€ and listen: 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. less path, more slay. it's a yes/no vibe.
  • --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. the -p is short, the path is where your build lives, periodt.
  • -q β€” Reduce terminal output. quiet mode, the "I'm not mad I'm just tired" of flags 😌
  • --query-symbol=<string> β€” Query a given symbol (e.g. "a::b::foo") in database directly without parsing the file. skip the parsing era entirely, just ask the database straight up.
  • --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. so your editor pipes stuff in, the virtual file system gets a lil makeover, and the tool runs on the new content using the source file's own compilation options. cute. editor-core fr fr.
  • --style=<string> β€” Fallback style for reformatting after inserting new headers if there is no clang-format config file found. it's the backup outfit for when there's no clang-format config to copy from πŸŽ€

bestie warning: --insert-header should run with STDIN mode and writes its result to stdout β€” that's the documented deal, don't freelance it πŸ’…

and that's the whole page, you made it!! πŸ₯³ this was clang-include-fixer 16, from October 2023, straight out of the CLANG-INCLUDE-FIXER(1) manual, User Commands edition. go forth and let the tool find your includes for you, you absolute icon πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from