From 4dd2faad2b0ad7e355364b29a4732680ced633fc Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Thu, 30 Oct 2008 22:05:00 +0000 Subject: [PATCH] Added -v option to print version info --- rc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rc.c b/rc.c index 924a6f3..f619f27 100644 --- a/rc.c +++ b/rc.c @@ -177,12 +177,18 @@ int main (int argc, char **argv) { sprintf(hiscoreserver, "ratcatcher.nethack.net"); hiscoreport = 80; + // set program name (including version string) + sprintf(progname, "Rat Catcher v0.%d", REV); + /* handle arguments */ if (argc >= 2) { for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-fs")) { printf("Fullscreen mode enabled.\n"); fullscreen = B_TRUE; + } else if (!strcmp(argv[i], "-v")) { + printf("%s\n",progname); + exit(1); } else if (!strcmp(argv[i], "-d")) { if (++i >= argc) { printf("Missing data dir.\n"); @@ -247,8 +253,6 @@ int main (int argc, char **argv) { datadir = strdup("data"); } - // set program name (including version string) - sprintf(progname, "Rat Catcher v0.%d", REV); initsdl(); if (TTF_Init()) {