From 5c896eae6efbda5c029506e3dca0fae238a9e96d Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 30 Sep 2023 15:34:49 +0100 Subject: [PATCH] [cpp] --version ``` $ ./rosettaboy-release --version Apple LLVM 15.0.0 (clang-1500.0.40.1) ``` --- cpp/src/args.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/src/args.cpp b/cpp/src/args.cpp index 24319b4d..e517b341 100644 --- a/cpp/src/args.cpp +++ b/cpp/src/args.cpp @@ -14,6 +14,7 @@ Args::Args(int argc, char *argv[]) { args::ValueFlag frames(parser, "frames", "Exit after N frames", {'f', "frames"}); args::ValueFlag profile(parser, "profile", "Exit after N seconds", {'p', "profile"}); args::Flag turbo(parser, "turbo", "No sleep between frames", {'t', "turbo"}); + args::Flag version(parser, "version", "Show build info", {'v', "version"}); args::Positional rom(parser, "rom", "Path to a .gb file"); args::CompletionFlag completion(parser, {"complete"}); @@ -33,6 +34,12 @@ Args::Args(int argc, char *argv[]) { return; } + if(version) { + std::cout << __VERSION__ << std::endl; + this->exit_code = 0; + return; + } + this->headless = headless; this->silent = silent; this->debug_cpu = debug_cpu; @@ -43,4 +50,4 @@ Args::Args(int argc, char *argv[]) { this->profile = profile ? args::get(profile) : 0; this->turbo = turbo; this->rom = args::get(rom); -} \ No newline at end of file +}