# HG changeset patch # User Mike Becker # Date 1404306557 -7200 # Node ID 26707039d5a60dfacfdbea12e67c15dafa5706b6 # Parent 84f2e380a434dca3549c6a641a39ec3fe2a1ea13 added program version diff -r 84f2e380a434 -r 26707039d5a6 src/main.c --- a/src/main.c Mon Jun 16 15:41:06 2014 +0200 +++ b/src/main.c Wed Jul 02 15:09:17 2014 +0200 @@ -41,7 +41,7 @@ uint8_t timeunit = 60; size_t len; - for (int opt ; (opt = getopt(argc, argv, "a:bc:hp:rsS:t:")) != -1 ;) { + for (int opt ; (opt = getopt(argc, argv, "a:bc:hp:rsS:t:v")) != -1 ;) { switch (opt) { case 'c': settings->continuepgn = optarg; @@ -92,10 +92,35 @@ settings->port = optarg; } break; + case 'v': + printf("terminal-chess : Version %s (Netcode Version %d)\n", + PROGRAM_VERSION, NETCODE_VERSION); + exit(0); case 'h': case '?': - settings->printhelp = 1; - break; + printf( +"Usage: terminal-chess [OPTION]... [HOST]\n" +"Starts/joins a network chess game\n" +"\nGeneral options\n" +" -c Continue the specified game\n" +" -h This help page\n" +" -p TCP port to use (default: 27015)\n" +// TODO: implement and activate feature +//" -S Compute and print statistics for the specified game\n" +" -v Print version information and exists\n" +"\nServer options\n" +" -a