CLANG-RENAME(1)
π CLANG-RENAME(1) β the manual page, but make it make sense
okay bestie, sit down, hydrate, because today we're talking about clang-rename, and I promise it's not as scary as the name suggests. this is the User Commands section of the manual, and yes, the page header is literally CLANG-RENAME(1) β that's just the manual-name flex. let's go. π¦
β¨ NAME β¨
clang-rename β no cap, it's the manual page for clang-rename 12. that's the whole name section. iconic brevity. π
πΈ DESCRIPTION πΈ
here's how you actually run the thing:
USAGE: clang-rename [options] <source0> [... <sourceN>]
so it's clang-rename, then your options, then one or more source files. <source0> is required, and then [... <sourceN>] means you can keep stacking more source files on there like it's a snack run. π
and then, the options. we've got two little families: the Generic Options that basically every clang tool has, and the clang-rename common options that are the actual main characters. π
π OPTIONS π
π«Ά Generic Options
these are the universal ones, the "hi nice to meet you" options.
--helpβ shows you the available options. and if you want the spicy hidden ones,--help-hiddengives you more. π--help-listβ prints a whole list of the available options. and yeah,--help-list-hiddenexists too for more. β¨--versionβ tells you what version of this program you're running. simple. clean. slay.
π clang-rename common options
okay this is the good part, this is where the actual renaming happens.
--export-fixes=<filename>β a YAML file to store suggested fixes in. so it writes the fix suggestions out to<filename>instead of just rawdogging your code. very demure, very mindful. π--extra-arg=<string>β an additional argument to append to the compiler command line. appended, bestie. after. remember that. π--extra-arg-before=<string>β an additional argument to prepend to the compiler command line. prepend = goes in front. this is the prequel to the previous option. π§--forceβ ignores nonexistent qualified names. it's giving "I don't care if that name doesn't exist, we ball." π₯-iβ overwrites edited<file>s. as in, it edits the file in place. no backup, no copy, it just goes in there. π«£--input=<string>β a YAML file to load oldname-newname pairs from. so you can hand it a whole shopping list of renames at once. ποΈ--new-name=<string>β the new name you want to change the symbol to. this is the destination. the glow-up. the after photo. π--offset=<uint>β locates the symbol by offset as opposed to<line>:<column>. so instead of pointing at a line and column, you point at a byte offset. pick your fighter. β-p=<string>β build path. that's it, that's the description, keep it moving. πΈ--plβ prints the locations affected by renaming to stderr. not stdout. stderr. the β¨dramaβ¨ channel. π--pnβ prints the found symbol's name prior to renaming to stderr. so you see what it was before the transformation. before pic energy. πΈ--qualified-name=<string>β the fully qualified name of the symbol. the whole entire government name. no nicknames. π
lowkey important:--offset,--new-name,--qualified-name, and--inputare all how you tell it what to rename β and-iis the one that actually writes changes back to your files, so know what you're doing before you send it. π
and that's the whole page, bestie. this was clang-rename 12, dated February 2022, living in the User Commands section of the manual like the little legend it is. go rename something responsibly. πβ¨π
π¦ where this page comes from
- ubuntu jammy: clang-tools-12 1:12.0.1-19ubuntu3 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms