Skip to content

Commit

Permalink
Display version ("hsm-analyze 1.0.0.0") when -version is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiorano committed May 19, 2017
1 parent 426be59 commit 6fc2316
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/HsmAnalyze.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "clang/Basic/Version.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Tooling/CommonOptionsParser.h"
#include "clang/Tooling/Tooling.h"
Expand All @@ -12,6 +13,8 @@ using namespace clang::ast_matchers;
using namespace clang::tooling;
using namespace llvm;

const char *ToolName = "hsm-analyze";
const char *ToolVersiona = "1.0.0.0";
static const char *ToolDescription = "A tool that analyzes C++ code that makes "
"use of the HSM library "
"(https://github.com/amaiorano/hsm)\n";
Expand All @@ -27,7 +30,13 @@ static cl::opt<bool>

static cl::extrahelp CommonHelp(CommonOptionsParser::HelpMessage);

static void PrintVersion() {
outs() << ToolName << " " << ToolVersiona << '\n';
}

int main(int argc, const char **argv) {
cl::AddExtraVersionPrinter(PrintVersion);

CommonOptionsParser OptionsParser(argc, argv, HsmAnalyzeCategory,
ToolDescription);

Expand Down

0 comments on commit 6fc2316

Please sign in to comment.