CLANG-RENAME(1)

πŸ“¦ version 12.0.1, in ubuntu jammy

πŸ’… 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-hidden gives you more. πŸ™ˆ
  • --help-list β€” prints a whole list of the available options. and yeah, --help-list-hidden exists 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 --input are all how you tell it what to rename β€” and -i is 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