Skip to content

Commit

Permalink
Add --version command line parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Dasperal committed Oct 28, 2024
1 parent ebd7024 commit f3b5460
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/i_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,35 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include <config.h>
#include <git_info.h>

#include "doomdef.h"
#include "m_misc.h"
#include "d_main.h"

int main (int argc, char** argv)
static void printVersion(void)
{
printf("Russian Doom DOS " PACKAGE_VERSION GIT_VERSION_SUFFIX "\n");
printf("Revision: %s (%s)\n", GIT_SHA, GIT_TIME);
}

int main(int argc, char** argv)
{
// [JN] Use current time as seed for random generator.
srand(time(0));

myargc = argc;
myargv = argv;

D_DoomMain ();
if(M_CheckParm("--version"))
{
printVersion();
return 0;
}

D_DoomMain();

return 0;
}

0 comments on commit f3b5460

Please sign in to comment.