r358337 - [CommandLineParser] Add DefaultOption flag
Don Hinton via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 13 09:55:28 PDT 2019
Author: dhinton
Date: Sat Apr 13 09:55:28 2019
New Revision: 358337
URL: http://llvm.org/viewvc/llvm-project?rev=358337&view=rev
Log:
[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
Modified:
cfe/trunk/lib/Tooling/CommonOptionsParser.cpp
Modified: cfe/trunk/lib/Tooling/CommonOptionsParser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/CommonOptionsParser.cpp?rev=358337&r1=358336&r2=358337&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/CommonOptionsParser.cpp (original)
+++ cfe/trunk/lib/Tooling/CommonOptionsParser.cpp Sat Apr 13 09:55:28 2019
@@ -83,8 +83,6 @@ std::vector<CompileCommand> ArgumentsAdj
llvm::Error CommonOptionsParser::init(
int &argc, const char **argv, cl::OptionCategory &Category,
llvm::cl::NumOccurrencesFlag OccurrencesFlag, const char *Overview) {
- static cl::opt<bool> Help("h", cl::desc("Alias for -help"), cl::Hidden,
- cl::sub(*cl::AllSubCommands));
static cl::opt<std::string> BuildPath("p", cl::desc("Build path"),
cl::Optional, cl::cat(Category),
More information about the cfe-commits
mailing list