Index: llvm/trunk/test/tools/llvm-ar/help-message.test =================================================================== --- llvm/trunk/test/tools/llvm-ar/help-message.test +++ llvm/trunk/test/tools/llvm-ar/help-message.test @@ -0,0 +1,6 @@ +# RUN: llvm-ar h | FileCheck %s +# RUN: llvm-ar -h | FileCheck %s +# RUN: llvm-ar -help | FileCheck %s +# RUN: llvm-ar --help | FileCheck %s + +# CHECK: USAGE: llvm-ar Index: llvm/trunk/tools/llvm-ar/llvm-ar.cpp =================================================================== --- llvm/trunk/tools/llvm-ar/llvm-ar.cpp +++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp @@ -70,14 +70,14 @@ llvm-ar -M [ - Ignored for compatibility - --help - Display available options - --version - Display the version of this program + --plugin= - ignored for compatibility + -h --help - display this help and exit + --version - print the version and exit @ - read options from OPERATIONS: @@ -1030,7 +1030,7 @@ } static bool handleGenericOption(StringRef arg) { - if (arg == "-help" || arg == "--help") { + if (arg == "h" || arg.startswith("-h") || arg == "--help") { printHelpMessage(); return true; }