From a46c49c89a8f9d162cb84e627cfe9bc22098ec2c Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 23 May 2022 14:34:36 -0700 Subject: [PATCH] Add `-version` command-line argument Probably should have done this earlier in 2.3, but better late than never. This makes it easier for third-party programs like Ved to detect what version of the game this is. Slightly quick-n-dirty for now, I'll de-duplicate the version number later, and add commit hash and date if applicable. --- desktop_version/src/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 1280c5d1..ab42ce5f 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -383,7 +383,15 @@ int main(int argc, char *argv[]) VVV_exit(1); \ } - if (ARG("-renderer")) + if (ARG("-version")) + { + /* Just print the version and exit. No vlogging. */ + /* TODO: Version should be de-duplicated and only set in one place... TwT */ + /* TODO: Also print commit date and hash, if applicable. */ + puts("VVVVVV v2.4"); + VVV_exit(0); + } + else if (ARG("-renderer")) { ARG_INNER({ i++;