[PATCH] D104889: [llvm-strings] Switch command line parsing from llvm::cl to OptTable
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 28 00:23:49 PDT 2021
jhenderson added a comment.
In D104889#2841696 <https://reviews.llvm.org/D104889#2841696>, @MaskRay wrote:
> In D104889#2840283 <https://reviews.llvm.org/D104889#2840283>, @jhenderson wrote:
>
>> Oh, I think this also loses the --color option, which turns off the error message colouring, if I'm not mistaken. I'm not sure either way how important this is, but thought I'd best flag it up.
>
> `--color` is provided by a `Support/WithColor.cpp` cl::opt which doesn't do anything in llvm-strings.
> I guess it cannot be discarded by linker GC due to some references from Support/ .
I dug into the code more, rather than just going off of faulty memory. In other tools at least, --color controls the output colour of error message prefixes, i.e. when printing an error message via WithColor, e.g. "error: some error message" the "error:" prefix is coloured in console output, but can be turned off/on in other contexts etc. llvm-strings however, just prints straight to `errs()` without going via `WithColor`. This is actually a bug in llvm-strings in my opinion (we should be consistent with how our messages are printed across the tools). It is however somewhat tangential to this patch, and whilst this bug is present, there's little point in the --color option to my knowledge.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104889/new/
https://reviews.llvm.org/D104889
More information about the llvm-commits
mailing list