add cli option -v/--version

This commit is contained in:
psychocrypt
2017-11-11 22:19:48 +01:00
parent 062287ad47
commit f0875b614c
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -32,6 +32,7 @@ The miner allow to overwrite some of the settings via command line options.
Usage: xmr-stak [OPTION]...
-h, --help show this help
-v, --version show version number
-c, --config FILE common miner configuration file
--currency NAME currency to mine: monero or aeon
--noCPU disable the CPU miner backend
+6
View File
@@ -63,6 +63,7 @@ void help()
cout<<"Usage: "<<params::inst().binaryName<<" [OPTION]..."<<endl;
cout<<" "<<endl;
cout<<" -h, --help show this help"<<endl;
cout<<" -v, --version show version number"<<endl;
cout<<" -c, --config FILE common miner configuration file"<<endl;
#if (!defined(CONF_NO_AEON)) && (!defined(CONF_NO_MONERO))
cout<<" --currency NAME currency to mine: monero or aeon"<<endl;
@@ -296,6 +297,11 @@ int main(int argc, char *argv[])
//win_exit();
return 0;
}
if(opName.compare("-v") == 0 || opName.compare("--version") == 0)
{
std::cout<< "Version: " << get_version_str() << std::endl;
return 0;
}
else if(opName.compare("--noCPU") == 0)
{
params::inst().useCPU = false;