[PATCH] D21485: [cl] Teach cl to support the notion of sub commands (e.g. "git checkout <foo>")
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 17 16:28:40 PDT 2016
zturner created this revision.
zturner added reviewers: beanz, chandlerc, rnk.
zturner added a subscriber: llvm-commits.
This patch improves cl to support sub commands. For example, "git checkout", "git status", etc where each subcommand has an unrelated set of options.
An example of how to use this new functionality is included in this patch where the `llvm-pdbdump` tool is updated to use this new functionality. If / when this patch is accepted, I will only submit with the changes to `cl`, and then submit the changes to `llvm-pdbdump` as a followup. It's only included here as an example.
Any code which was previously written against cl will continue to work unmodified. If you don't specify a subcommand for an option, commands go into the "top level" subcommand, which is searched when no subcommand is specified.
There is another special subcommand called `AllSubcommands` which, when specified, will inject an option into every sub command. This is useful, for example, to make `foo.exe --help` and `foo.exe command --help` both work and do the right thing.
options can also have multiple subcommands, so that the same option will appear in multiple subcommands.
Help output is updated as well to print info about supported subcommands, and also to print the list of options for individual subcommands.
Not sure who to include as a reviewer, feel free to add others as appropriate.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 76586 bytes
Desc: not available
More information about the llvm-commits