CLANG-INCLUDE-FIXER(1)

πŸ“¦
version 15.0.7 Β· 3 versions
, in ubuntu jammy

πŸ’– NAME πŸ’–

clang-include-fixer β€” bestie, this is the manual page for clang-include-fixer 15 πŸ¦‹


✨ DESCRIPTION ✨

okay so here's the vibe. You run it like this:

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

and then there are OPTIONS. so many options. let's get into it πŸ’…

🌸 Generic Options 🌸

  • --help β€” shows you all the available options (--help-hidden gets you even more, lowkey a lot)
  • --help-list β€” prints out the list of available options (--help-list-hidden for even more)
  • --version β€” tells you what version of this program you're running

πŸŽ€ Tool options πŸŽ€

  • --db=<value> β€” specify the input format. the options for value are:
    • =fixed β€” hard-coded mapping
    • =yaml β€” a Yaml database, the kind created by find-all-symbols
    • =fuzzyYaml β€” a Yaml database, but with fuzzy-matched names
  • --extra-arg=<string> β€” an extra argument to append to the compiler command line
  • --extra-arg-before=<string> β€” an extra argument to prepend to the compiler command line
  • --input=<string> β€” a string to initialize the database with
  • --insert-header=<string> β€” insert one specific header. this one should run with STDIN mode, bestie. the result gets written to stdout, and rn it's 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 plus all its relevant headers in JSON format to stdout, like this:
{      "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 (quiet girl era πŸ™ˆ)
  • --query-symbol=<string> β€” query a given symbol (like "a::b::foo") directly in the database, no file parsing needed
  • --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 for reformatting after inserting new headers, for when there's no clang-format config file to be found

and that's the whole thing, no cap πŸ’œ this was clang-include-fixer 15, from July 2023, part of User Commands β€” go forth and let the includes fix themselves, you've got this 🫢✨

πŸ“¦ where this page comes from