Alexei Svitkine
2009-Feb-18 04:00 UTC
[LLVMdev] Patch: Prefix for ParseCommandLineOptions()
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>
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
Alexei Svitkine
2009-Mar-04 08:15 UTC
[LLVMdev] Patch: Prefix for ParseCommandLineOptions()
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 >
Seemingly Similar Threads
- [LLVMdev] Patch: Prefix for ParseCommandLineOptions()
- [LLVMdev] Patch: Prefix for ParseCommandLineOptions()
- [LLVMdev] Patch: Prefix for ParseCommandLineOptions()
- [LLVMdev] Patch: Prefix for ParseCommandLineOptions()
- [LLVMdev] patch to enable response file support in ParseCommandLineOptions