summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-ar/llvm-ar.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-09-17 09:25:52 +0000
committerFangrui Song <maskray@google.com>2019-09-17 09:25:52 +0000
commit1ecba6f8efd2bdc466b4811081573186abd9a975 (patch)
tree271b10bfb5c1031830a5dda968ef7172e9b442ea /llvm/tools/llvm-ar/llvm-ar.cpp
parentde1bef0b1b2d111e07450686843dec76e2763130 (diff)
downloadbcm5719-llvm-1ecba6f8efd2bdc466b4811081573186abd9a975.tar.gz
bcm5719-llvm-1ecba6f8efd2bdc466b4811081573186abd9a975.zip
[llvm-ar] Parse 'h' and '-h': display help and exit
Support `llvm-ar h` and `llvm-ar -h` because they may be what users try at first. Note, operation 'h' is undocumented in GNU ar. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D67560 llvm-svn: 372088
Diffstat (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp')
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 9447298421b..006d8ed74cf 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -70,14 +70,14 @@ USAGE: llvm-ar [options] [-]<operation>[modifiers] [relpos] [count] <archive> [f
llvm-ar -M [<mri-script]
OPTIONS:
- --format - Archive format to create
+ --format - archive format to create
=default - default
=gnu - gnu
=darwin - darwin
=bsd - bsd
- --plugin=<string> - Ignored for compatibility
- --help - Display available options
- --version - Display the version of this program
+ --plugin=<string> - ignored for compatibility
+ -h --help - display this help and exit
+ --version - print the version and exit
@<file> - read options from <file>
OPERATIONS:
@@ -1030,7 +1030,7 @@ static void runMRIScript() {
}
static bool handleGenericOption(StringRef arg) {
- if (arg == "-help" || arg == "--help") {
+ if (arg == "h" || arg.startswith("-h") || arg == "--help") {
printHelpMessage();
return true;
}
OpenPOWER on IntegriCloud