diff options
| author | Don Hinton <hintonda@gmail.com> | 2019-04-15 17:18:10 +0000 |
|---|---|---|
| committer | Don Hinton <hintonda@gmail.com> | 2019-04-15 17:18:10 +0000 |
| commit | b85f74a283a62246d60083f52c779171a65a091c (patch) | |
| tree | a040f295ef3cd48b61571e1f0a4adf7f755f1fc2 /llvm/docs | |
| parent | 8e364c680fab1724bd0d4749b8d1177843164aa7 (diff) | |
| download | bcm5719-llvm-b85f74a283a62246d60083f52c779171a65a091c.tar.gz bcm5719-llvm-b85f74a283a62246d60083f52c779171a65a091c.zip | |
[CommandLineParser] Add DefaultOption flag
Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as needed.
Also, add `-h` as a default alias to `-help`, which can be seamlessly
overridden by applications like llvm-objdump and llvm-readobj which
use `-h` as an alias for other options.
(relanding after revert, r358414)
Added DefaultOptions.clear() to reset().
Reviewers: alexfh, klimek
Reviewed By: klimek
Subscribers: kristina, MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D59746
llvm-svn: 358428
Diffstat (limited to 'llvm/docs')
| -rw-r--r-- | llvm/docs/CommandLine.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/docs/CommandLine.rst b/llvm/docs/CommandLine.rst index 46ba6d32bb3..d34fb2c3822 100644 --- a/llvm/docs/CommandLine.rst +++ b/llvm/docs/CommandLine.rst @@ -128,6 +128,7 @@ this: USAGE: compiler [options] OPTIONS: + -h - Alias for -help -help - display available options (-help-hidden for more) -o <filename> - Specify output filename @@ -194,6 +195,7 @@ declarations above, the ``-help`` option synopsis is now extended to: USAGE: compiler [options] <input file> OPTIONS: + -h - Alias for -help -help - display available options (-help-hidden for more) -o <filename> - Specify output filename @@ -1251,6 +1253,14 @@ specify boolean properties that modify the option. with ``cl::CommaSeparated``, this modifier only makes sense with a `cl::list`_ option. +.. _cl::DefaultOption: + +* The **cl::DefaultOption** modifier is used to specify that the option is a + default that can be overridden by application specific parsers. For example, + the ``-help`` alias, ``-h``, is registered this way, so it can be overridden + by applications that need to use the ``-h`` option for another purpose, + either as a regular option or an alias for another option. + .. _response files: Response files |

