Implement --version switch
This commit is contained in:
parent
5da79d744e
commit
d270b052ec
13
src/main.d
13
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.
|
||||
|
|
Loading…
Reference in New Issue