OSDN Git Service

[CommandLineParser] Add DefaultOption flag
authorDon Hinton <hintonda@gmail.com>
Mon, 15 Apr 2019 17:18:10 +0000 (17:18 +0000)
committerDon Hinton <hintonda@gmail.com>
Mon, 15 Apr 2019 17:18:10 +0000 (17:18 +0000)
commitf944830706cfe6d9fd8ed1f0e78650e150f77de1
treef1c42f4b98df0aa0af4e8f41ed15300ff3ff7673
parent592ca89b48ccab8b48e7e6fd9b13114ad3c515d8
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358428 91177308-0d34-0410-b5e6-96231b3b80d8
docs/CommandLine.rst
include/llvm/Support/CommandLine.h
lib/Support/CommandLine.cpp
test/Support/check-default-options.txt [new file with mode: 0644]
tools/llvm-opt-report/OptReport.cpp
unittests/Support/CommandLineTest.cpp