Build 0.7.3:

Added version number support in Version.cpp; this file should be updated for each new build.
Added -version command line option so people can print the version of RetroFE without running the actual front-end.
This commit is contained in:
Pieter Hulshoff 2016-08-24 12:36:47 +02:00
parent 9c15295a26
commit 3e62adcadd
2 changed files with 32 additions and 26 deletions

View File

@ -31,6 +31,32 @@ static bool StartLogging();
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
// check to see if version or help was requested
if(argc > 1)
{
std::string program = argv[0];
std::string param = argv[1];
if(argc == 3 && param == "-createcollection")
{
// Do nothing; we handle that later
}
else if(param == "-version")
{
std::cout << "RetroFE version " << Version::getString( ) << std::endl;
return 0;
}
else
{
std::cout << "Usage:" << std::endl;
std::cout << program << " Run RetroFE" << std::endl;
std::cout << program << " -version Print the version of RetroFE." << std::endl;
std::cout << program << " -createcollection <collection name> Create a collection directory structure." << std::endl;
return 0;
}
}
// Initialize random seed // Initialize random seed
srand(static_cast<unsigned int>(time(0))); srand(static_cast<unsigned int>(time(0)));

View File

@ -15,36 +15,16 @@
*/ */
#include "Version.h" #include "Version.h"
#include <sstream> #include <string>
#ifndef RETROFE_VERSION_MAJOR
#define RETROFE_VERSION_MAJOR 0
#endif
#ifndef RETROFE_VERSION_MINOR std::string retrofe_version_major = "0";
#define RETROFE_VERSION_MINOR 0 std::string retrofe_version_minor = "7";
#endif std::string retrofe_version_build = "3";
#ifndef RETROFE_VERSION_BUILD
#define RETROFE_VERSION_BUILD 0
#endif
#ifndef RETROFE_VERSION_PROD
#define RETROFE_VERSION_BETA
#endif
std::string Version::getString() std::string Version::getString()
{ {
std::stringstream version; std::string return_string = retrofe_version_major + "." + retrofe_version_minor + "." + retrofe_version_build;
version << RETROFE_VERSION_MAJOR; return return_string;
version << ".";
version << RETROFE_VERSION_MINOR;
version << ".";
version << RETROFE_VERSION_BUILD;
#ifdef RETROFE_VERSION_BETA
version << "-beta";
#endif
return version.str();
} }