Allow clang tools to display an overview when using the CommonOptionsParser.

Patch by Guillaume Papin.

llvm-svn: 186671
This commit is contained in:
Manuel Klimek
2013-07-19 12:20:59 +00:00
parent dce2347f6d
commit 7a698519e8
2 changed files with 4 additions and 3 deletions

View File

@@ -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() {

View File

@@ -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;