X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2Fmain.cpp;h=19bfa6ecde6ccee12be0c00bdbc254fcf99ba49e;hp=3e37f646a81462aa9666054f6c6e2cfadf2b18ea;hb=1198f8141fe7d5b04a936935c45af3217064b0d7;hpb=848100cb2fe6ac3851b481a08876dc85129b0208 diff --git a/Source/main.cpp b/Source/main.cpp index 3e37f64..19bfa6e 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -24,6 +24,7 @@ along with Lugaru. If not, see . #include "Graphic/gamegl.hpp" #include "MacCompatibility.hpp" #include "User/Settings.hpp" +#include "Version.hpp" #include #include @@ -588,6 +589,7 @@ const option::Descriptor usage[] = { { UNKNOWN, 0, "", "", option::Arg::None, "USAGE: lugaru [options]\n\n" "Options:" }, + { VERSION, 0, "v", "version", option::Arg::None, " -v, --version Print version and exit." }, { HELP, 0, "h", "help", option::Arg::None, " -h, --help Print usage and exit." }, { FULLSCREEN, 1, "f", "fullscreen", option::Arg::None, " -f, --fullscreen Start the game in fullscreen mode." }, { FULLSCREEN, 0, "w", "windowed", option::Arg::None, " -w, --windowed Start the game in windowed mode (default)." }, @@ -620,6 +622,23 @@ int main(int argc, char** argv) return 1; } + // Always start by printing the version and info to the stdout + std::cout << "--------------------------------------------------------------------------\n" + << "Lugaru HD: The Rabbit's Foot, by Wolfire Games and the OSS Lugaru project.\n\n" + << "Licensed under the GPL 2.0+ and CC-BY-SA 3.0 and 4.0 licenses.\n" + << "More information, updates and bug reports at http://osslugaru.gitlab.io\n" + << std::endl; + + std::cout << "Version " + VERSION_STRING + " -- " + VERSION_BUILD_TYPE + " build\n" + << "--------------------------------------------------------------------------\n" + << std::endl; + + if (commandLineOptions[VERSION]) { + // That was enough, quit. + delete[] commandLineOptionsBuffer; + return 0; + } + if (commandLineOptions[HELP]) { option::printUsage(std::cout, usage); delete[] commandLineOptionsBuffer;