@@ -77,6 +77,8 @@ persisted in a simple database by snis_multiverse.
77
77
#include "snis_asset_dir.h"
78
78
#include "snis_bin_dir.h"
79
79
#include "snis_licenses.h"
80
+ #include "snis_version.h"
81
+ #include "build_info.h"
80
82
81
83
static char * asset_dir ;
82
84
static char * lobby , * nick , * location ;
@@ -1296,6 +1298,7 @@ static struct option long_options[] = {
1296
1298
{ "lobby" , required_argument , NULL , 'l' },
1297
1299
{ "servernick" , required_argument , NULL , 'n' },
1298
1300
{ "location" , required_argument , NULL , 'L' },
1301
+ { "version" , no_argument , NULL , 'v' },
1299
1302
{ 0 , 0 , 0 , 0 },
1300
1303
};
1301
1304
@@ -1309,11 +1312,13 @@ static void parse_options(int argc, char *argv[], char **lobby, char **nick, cha
1309
1312
1310
1313
if ((argc < 4 ) &&
1311
1314
(argc != 2 || (strcmp (argv [1 ], "--acknowledgments" ) != 0 &&
1312
- strcmp (argv [1 ], "--acknowledgements" ) != 0 )))
1315
+ strcmp (argv [1 ], "--acknowledgements" ) != 0 &&
1316
+ strcmp (argv [1 ], "--version" ) != 0 &&
1317
+ strcmp (argv [1 ], "-v" ) != 0 )))
1313
1318
usage ();
1314
1319
while (1 ) {
1315
1320
int option_index ;
1316
- c = getopt_long (argc , argv , "ae:L:l:n:" , long_options , & option_index );
1321
+ c = getopt_long (argc , argv , "ae:L:l:n:v " , long_options , & option_index );
1317
1322
if (c == -1 )
1318
1323
break ;
1319
1324
switch (c ) {
@@ -1339,6 +1344,11 @@ static void parse_options(int argc, char *argv[], char **lobby, char **nick, cha
1339
1344
case 'n' :
1340
1345
* nick = optarg ;
1341
1346
break ;
1347
+ case 'v' :
1348
+ printf ("snis_multiverse " );
1349
+ printf ("%s\n" , BUILD_INFO_STRING1 );
1350
+ printf ("%s\n" , BUILD_INFO_STRING2 );
1351
+ exit (0 );
1342
1352
default :
1343
1353
usage (); /* no return */
1344
1354
break ;
0 commit comments