[PATCH] D93494: [Support] Indent multi-line descr of enum cli options.

Joachim Meyer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 6 13:21:58 PDT 2021


fodinabor added a comment.

mhh... I'd just say the assert was wrong.
The `BaseIndent` is the maximum width of an option. e.g. `--compilation-database=<string>`.
`printEnumValHelpStr` does not deal with that part at all, only with the help string that comes after that (e.g. `This is the first enum value\nwhich has a really long description\nthus it is multi-line.`).
For nice formatting in the first line ` - ` and `   ` are prepended for the enum values in the first line and later BaseIndent + `  ` are used for the indent.
What the assert should have verified is only that `BaseIndent >= FirstLineIndentedBy` so that we can later have the indent: `BaseIndent - FirstLineIndentedBy` and be sure it's >=0.
(and that really should always be true..)

So I will just adapt the assert..


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93494/new/

https://reviews.llvm.org/D93494



More information about the llvm-commits mailing list