Added --version

This commit is contained in:
Sude 2014-02-06 09:27:30 +02:00
parent 3b4def2ebe
commit d2421ba4f8

View File

@ -114,6 +114,7 @@ int main(int argc, char *argv[])
// Commandline options (no config file) // Commandline options (no config file)
options_cli_no_cfg.add_options() options_cli_no_cfg.add_options()
("help,h", "Print help message") ("help,h", "Print help message")
("version", "Print version information")
("login", bpo::value<bool>(&config.bLogin)->zero_tokens()->default_value(false), "Login") ("login", bpo::value<bool>(&config.bLogin)->zero_tokens()->default_value(false), "Login")
("list", bpo::value<bool>(&config.bList)->zero_tokens()->default_value(false), "List games") ("list", bpo::value<bool>(&config.bList)->zero_tokens()->default_value(false), "List games")
("list-details", bpo::value<bool>(&config.bListDetails)->zero_tokens()->default_value(false), "List games with detailed info") ("list-details", bpo::value<bool>(&config.bListDetails)->zero_tokens()->default_value(false), "List games with detailed info")
@ -183,6 +184,12 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
if (vm.count("version"))
{
std::cout << VERSION_STRING << std::endl;
return 0;
}
if (vm.count("chunk-size")) if (vm.count("chunk-size"))
config.iChunkSize <<= 20; // Convert chunk size from bytes to megabytes config.iChunkSize <<= 20; // Convert chunk size from bytes to megabytes