Let XBoard print version with argument --version or -v
authorH.G. Muller <h.g.muller@hccnet.nl>
Wed, 6 Jan 2010 23:31:11 +0000 (00:31 +0100)
committerArun Persaud <arun@nubati.net>
Sat, 9 Jan 2010 20:01:12 +0000 (12:01 -0800)
xboard.c

index 3c4d8d7..e4c19e4 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -1665,6 +1665,11 @@ main(argc, argv)
     setbuf(stderr, NULL);
     debugFP = stderr;
 
+    if(argc > 1 && (!strcmp(argv[1], "-v" ) || !strcmp(argv[1], "--version" ))) {
+       printf("%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+       exit(0);
+    }
+
     programName = strrchr(argv[0], '/');
     if (programName == NULL)
       programName = argv[0];