[LLVMdev] Patch: Prefix for ParseCommandLineOptions()

Alexei Svitkine alexei.svitkine at gmail.com
Tue Feb 17 20:00:42 PST 2009


The motivation behind this patch is that tools that use LLVM as a
library and want to use its command line parsing facilities may not
want all the various options defined in the LLVM libraries to be
available - simply because they may not be relevant.

This patch adds an optional "Prefix" parameter to
ParseCommandLineOptions(). If set, this will make inaccessible any
options that do not begin with the prefix string. Any options with the
prefix string will act as if they were defined without that string.

For example, if prefix string is "foo-", and "foo-bar" is a defined
option, it will be displayed under --help as "--bar" and can be used
as "--bar". Any options without "foo-" prefix will not be displayed
under --help and will not be useable from the command line.

-Alexei
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CommandLinePrefix.diff
Type: application/octet-stream
Size: 11878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090217/b4895e83/attachment.obj>


More information about the llvm-dev mailing list