Skip to content

Commit

Permalink
[cpp] --version
Browse files Browse the repository at this point in the history
```
$ ./rosettaboy-release --version
Apple LLVM 15.0.0 (clang-1500.0.40.1)
```
  • Loading branch information
shish committed Sep 30, 2023
1 parent 4c2ef71 commit 0d62dca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cpp/src/args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Args::Args(int argc, char *argv[]) {
args::ValueFlag<int> frames(parser, "frames", "Exit after N frames", {'f', "frames"});
args::ValueFlag<int> 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<std::string> rom(parser, "rom", "Path to a .gb file");
args::CompletionFlag completion(parser, {"complete"});

Expand All @@ -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;
Expand All @@ -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);
}
}

0 comments on commit 0d62dca

Please sign in to comment.