Zachary Turner via llvm-dev
2016-Jun-30 17:54 UTC
[llvm-dev] PSA: llvm::cl now supports subcommands
I submitted this yesterday in r274171. I think this allows for a more intuitive way to structure the options of command line tools. It's optional and if you do nothing llvm::cl will work as it always has for you. Probably self explanatory, but here's some output of --help from llvm-pdbdump, which was updated to use subcommands in r274247, in case anyone wants to see what this looks like. D:\src\llvmbuild\clang-selfhost>bin\llvm-pdbdump --help OVERVIEW: LLVM PDB Dumper USAGE: llvm-pdbdump.exe [subcommand] [options] SUBCOMMANDS: pdb2yaml - Generate a detailed YAML description of a PDB File pretty - Dump semantic information about types and symbols raw - Dump raw structure of the PDB file yaml2pdb - Generate a PDB file from a YAML description Type "llvm-pdbdump.exe <subcommand> -help" to get more help on a specific subcommand OPTIONS: Generic Options: -help - Display available options (-help-hidden for more) -help-list - Display list of available options (-help-list-hidden for more) -version - Display the version of this program D:\src\llvmbuild\clang-selfhost>bin\llvm-pdbdump pretty --help OVERVIEW: LLVM PDB Dumper SUBCOMMAND 'pretty': Dump semantic information about types and symbols USAGE: llvm-pdbdump.exe pretty [options] <input PDB files> OPTIONS: Filtering Options: -exclude-compilands=<string> - Exclude compilands by regular expression -exclude-symbols=<string> - Exclude symbols by regular expression -exclude-types=<string> - Exclude types by regular expression -include-compilands=<string> - Include only compilands those which match a regular expression -include-symbols=<string> - Include only symbols which match a regular expression -include-types=<string> - Include only types which match a regular expression -no-class-definitions - Don't display full class definitions -no-compiler-generated - Don't show compiler generated types and symbols -no-enum-definitions - Don't display full enum definitions -no-system-libs - Don't show symbols from system libraries Generic Options: -help - Display available options (-help-hidden for more) -help-list - Display list of available options (-help-list-hidden for more) Other Options: -load-address=<uint> - Assume the module is loaded at the specified address Symbol Type Options: -all - Implies all other options in 'Symbol Types' category -compilands - Display compilands -externals - Dump external symbols -globals - Dump global symbols -lines - Line tables -symbols - Display symbols for each compiland -types - Display types D:\src\llvmbuild\clang-selfhost>bin\llvm-pdbdump pdb2yaml --help OVERVIEW: LLVM PDB Dumper SUBCOMMAND 'pdb2yaml': Generate a detailed YAML description of a PDB File USAGE: llvm-pdbdump.exe pdb2yaml [options] <input PDB file> OPTIONS: General options: -stream-directory - Dump each stream's block map (implies -stream-metadata) -stream-metadata - Dump the number of streams and each stream's size Generic Options: -help - Display available options (-help-hidden for more) -help-list - Display list of available options (-help-list-hidden for more) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160630/0ef66585/attachment.html>
Johan Engelen via llvm-dev
2016-Jul-01 15:00 UTC
[llvm-dev] PSA: llvm::cl now supports subcommands
On Thu, Jun 30, 2016 at 7:54 PM, Zachary Turner via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I submitted this yesterday in r274171. I think this allows for a more > intuitive way to structure the options of command line tools. It's > optional and if you do nothing llvm::cl will work as it always has for you. >Perhaps you could define a default parameter value for the new parameter of getRegisteredOptions(...) ? That, or the code example given in the comments should be fixed. I think a default parameter value = *cl::TopLevelSubCommand would mean that no code changes are necessary for downstream users (us ;). cheers, Johan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160701/8775cea8/attachment.html>
Zachary Turner via llvm-dev
2016-Jul-01 15:13 UTC
[llvm-dev] PSA: llvm::cl now supports subcommands
Seems reasonable, I'll take a look later On Fri, Jul 1, 2016 at 8:00 AM Johan Engelen <jbc.engelen at gmail.com> wrote:> On Thu, Jun 30, 2016 at 7:54 PM, Zachary Turner via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> I submitted this yesterday in r274171. I think this allows for a more >> intuitive way to structure the options of command line tools. It's >> optional and if you do nothing llvm::cl will work as it always has for you. >> > > Perhaps you could define a default parameter value for the new parameter > of getRegisteredOptions(...) ? That, or the code example given in the > comments should be fixed. > I think a default parameter value = *cl::TopLevelSubCommand would mean > that no code changes are necessary for downstream users (us ;). > > cheers, > Johan > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160701/cacde5e6/attachment.html>
Seemingly Similar Threads
- [LLVMdev] PSA: clang-cl can self host now!
- [LLVMdev] PSA: clang-cl can self host now!
- [LLVMdev] DebugInfo/PDB/pdbdump-symbol-format.test fails with VS 2015
- [LLVMdev] DebugInfo/PDB/pdbdump-symbol-format.test fails with VS 2015
- [llvm] r250383 - Speculatively unbreak Windows build