Russell Wallace
2015-Feb-04 14:53 UTC
[LLVMdev] Formatting of command line option help text
llvm-link and clang both have a -o option with similar meaning, but the help text describes it differently. llvm-link describes it as: -o=<filename> and clang describes it as -o <file> with no '=' between the option and the parameter. When I try using the command line options library, it comes out the same way as llvm-link, with no apparent method of getting it to come out the other way. This might be just a minor cosmetic question, but I've a feeling it actually points to a significant gap in my understanding of the command line options library, because when I tried checking the clang source code for the answer, the only relevant reference I could find was in some configuration or DSL file whose syntax and function I'm not familiar with. How exactly is clang getting that effect? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150204/51c20448/attachment.html>
Chris Bieneman
2015-Feb-04 18:20 UTC
[LLVMdev] Formatting of command line option help text
The LLVM toolchain, and many small LLVM based tools (like clang-format) use libSupport’s cl::ParseCommandLineOptions and related APIs for command line parsing. This results in the behavior you see with llvm-link. Clang, lld, and some of the other higher level tools use a TableGen driven process implemented in libOption. So, you get different help formats because the two APIs are completely independent. -Chris> On Feb 4, 2015, at 6:53 AM, Russell Wallace <russell.wallace at gmail.com> wrote: > > llvm-link and clang both have a -o option with similar meaning, but the help text describes it differently. > > llvm-link describes it as: > > -o=<filename> > > and clang describes it as > > -o <file> > > with no '=' between the option and the parameter. > > When I try using the command line options library, it comes out the same way as llvm-link, with no apparent method of getting it to come out the other way. This might be just a minor cosmetic question, but I've a feeling it actually points to a significant gap in my understanding of the command line options library, because when I tried checking the clang source code for the answer, the only relevant reference I could find was in some configuration or DSL file whose syntax and function I'm not familiar with. > > How exactly is clang getting that effect? > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev