shithub: choc

Download patch

ref: b00a10ae3398b04c6d6ad890fad80bd53aa7d763
parent: 54500659f97ba431de173129726211b65d84e4ad
author: Mike Swanson <[email protected]>
date: Sat Nov 3 02:43:14 EDT 2018

Add a -version parameter like most programs have

Supports both -version and --version, even though the later breaks
the normal convention of Doom parameters, it is common enough with
any general program that it should be useful to include in this.

--- a/src/i_main.c
+++ b/src/i_main.c
@@ -41,6 +41,17 @@
     myargc = argc;
     myargv = argv;
 
+    //!
+    // @arg
+    //
+    // Print the program version and exit.
+    //
+
+    if (M_ParmExists("-version") || M_ParmExists("--version")) {
+        puts (PACKAGE_NAME " " PACKAGE_VERSION);
+        exit (0);
+    }
+
     M_FindResponseFile();
 
     #ifdef SDL_HINT_NO_SIGNAL_HANDLERS