Allow clang tools to display an overview when using the CommonOptionsParser.
Patch by Guillaume Papin. llvm-svn: 186671
This commit is contained in:
@@ -64,7 +64,7 @@ public:
|
||||
/// This constructor can change argc and argv contents, e.g. consume
|
||||
/// command-line options used for creating FixedCompilationDatabase.
|
||||
/// This constructor exits program in case of error.
|
||||
CommonOptionsParser(int &argc, const char **argv);
|
||||
CommonOptionsParser(int &argc, const char **argv, const char *Overview = 0);
|
||||
|
||||
/// Returns a reference to the loaded compilations database.
|
||||
CompilationDatabase &getCompilations() {
|
||||
|
||||
@@ -53,7 +53,8 @@ const char *const CommonOptionsParser::HelpMessage =
|
||||
"\tsuffix of a path in the compile command database.\n"
|
||||
"\n";
|
||||
|
||||
CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv) {
|
||||
CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv,
|
||||
const char *Overview) {
|
||||
static cl::opt<std::string> BuildPath(
|
||||
"p", cl::desc("Build path"), cl::Optional);
|
||||
|
||||
@@ -62,7 +63,7 @@ CommonOptionsParser::CommonOptionsParser(int &argc, const char **argv) {
|
||||
|
||||
Compilations.reset(FixedCompilationDatabase::loadFromCommandLine(argc,
|
||||
argv));
|
||||
cl::ParseCommandLineOptions(argc, argv);
|
||||
cl::ParseCommandLineOptions(argc, argv, Overview);
|
||||
SourcePathList = SourcePaths;
|
||||
if (!Compilations) {
|
||||
std::string ErrorMessage;
|
||||
|
||||
Reference in New Issue
Block a user