[LLVMdev] Patch: Prefix for ParseCommandLineOptions()
Alexei Svitkine
alexei.svitkine at gmail.com
Wed Mar 4 00:15:43 PST 2009
I was thinking about this more, and perhaps a more preferable solution
would have some kind of OptionGroup parameter to constructors of cl
options. This would of course be optional, with the default being a
global one.
Then, ParseCommandLineOptions() could instead take as an optional
parameter an OptionGroup, and would then only work on cl options in
that group. Would this approach be preferable?
-Alexei
On Wed, Mar 4, 2009 at 2:04 AM, Evan Cheng <echeng at apple.com> wrote:
> I don't have any opinions about this. Chris?
>
> Evan
> On Feb 17, 2009, at 8:00 PM, Alexei Svitkine wrote:
>
>> 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
>> <
>> CommandLinePrefix.diff>_______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
More information about the llvm-dev
mailing list