summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorDon Hinton <hintonda@gmail.com>2019-04-13 16:55:28 +0000
committerDon Hinton <hintonda@gmail.com>2019-04-13 16:55:28 +0000
commit7d2021defcad20f79929c211de4c593c6073a906 (patch)
tree6b3af8c4afcbac310f7e35296a709f3385ae615a /llvm/docs
parent5f3a04510a5dbd34f21c570a6aaae4274c910032 (diff)
downloadbcm5719-llvm-7d2021defcad20f79929c211de4c593c6073a906.tar.gz
bcm5719-llvm-7d2021defcad20f79929c211de4c593c6073a906.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. Reviewers: alexfh, klimek Reviewed By: klimek Subscribers: MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D59746 llvm-svn: 358337
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/CommandLine.rst10
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
OpenPOWER on IntegriCloud