From d270b052ec8b61d5afe92c9a4a4417d94888b385 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Mon, 15 Sep 2014 22:19:33 -0700 Subject: [PATCH] Implement --version switch --- src/main.d | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.d b/src/main.d index 7723c82..0c16233 100644 --- a/src/main.d +++ b/src/main.d @@ -59,6 +59,7 @@ int run(string[] args) bool report; string symbolName; string configLocation; + bool printVersion; try { @@ -68,7 +69,8 @@ int run(string[] args) "ast|xml", &ast, "imports|i", &imports, "outline|o", &outline, "tokenDump", &tokenDump, "styleCheck|S", &styleCheck, "defaultConfig", &defaultConfig, "declaration|d", &symbolName, - "config", &configLocation, "report", &report,"muffinButton", &muffin); + "config", &configLocation, "report", &report, + "version", &printVersion, "muffinButton", &muffin); } catch (ConvException e) { @@ -97,6 +99,12 @@ int run(string[] args) return 0; } + if (printVersion) + { + writeln("v0.1.0"); + return 0; + } + auto optionCount = count!"a"([sloc, highlight, ctags, tokenCount, syntaxCheck, ast, imports, outline, tokenDump, styleCheck, defaultConfig, report, symbolName !is null]); @@ -310,6 +318,9 @@ options: --help | -h Prints this help message + --version + Prints the program version + --sloc | -l [sourceFiles] Prints the number of logical lines of code in the given source files. If no files are specified, input is read from stdin.