src/main.c

changeset 90
395542d915d7
parent 89
58b788fd10a7
equal deleted inserted replaced
89:58b788fd10a7 90:395542d915d7
42 char *valid; 42 char *valid;
43 unsigned long int time, port; 43 unsigned long int time, port;
44 uint8_t timeunit = 60; 44 uint8_t timeunit = 60;
45 size_t len; 45 size_t len;
46 46
47 for (int opt ; (opt = getopt(argc, argv, "a:bc:hp:rsS:t:Uv")) != -1 ;) { 47 for (int opt ; (opt = getopt(argc, argv, "a:bc:Fhp:rsS:t:Uv")) != -1 ;) {
48 switch (opt) { 48 switch (opt) {
49 case 'c': 49 case 'c':
50 settings->continuepgn = optarg; 50 settings->continuepgn = optarg;
51 break; 51 break;
52 case 'b': 52 case 'b':
54 break; 54 break;
55 case 'r': 55 case 'r':
56 settings->gameinfo.servercolor = rand() & 1 ? WHITE : BLACK; 56 settings->gameinfo.servercolor = rand() & 1 ? WHITE : BLACK;
57 break; 57 break;
58 case 's': 58 case 's':
59 settings->singlemachine = 1; 59 settings->singlemachine = true;
60 break;
61 case 'F':
62 settings->disableflip = true;
60 break; 63 break;
61 case 'U': 64 case 'U':
62 settings->unicode = 0; 65 settings->unicode = false;
63 break; 66 break;
64 case 't': 67 case 't':
65 case 'a': 68 case 'a':
66 len = strlen(optarg); 69 len = strlen(optarg);
67 if (optarg[len-1] == 's') { 70 if (optarg[len-1] == 's') {
112 " -v Print version information and exits\n" 115 " -v Print version information and exits\n"
113 "\nServer options\n" 116 "\nServer options\n"
114 " -a <time> Specifies the time to add after each move\n" 117 " -a <time> Specifies the time to add after each move\n"
115 " -b Server plays black pieces (default: white)\n" 118 " -b Server plays black pieces (default: white)\n"
116 " -r Distribute color randomly\n" 119 " -r Distribute color randomly\n"
117 " -s Single machine mode\n"
118 " -t <time> Specifies time limit (default: no limit)\n" 120 " -t <time> Specifies time limit (default: no limit)\n"
121 "\nHot seat\n"
122 " -s Play a hot seat game (no client/server)\n"
123 " -F Do not automatically flip the board in hot seat games\n"
119 "\nNotes\n" 124 "\nNotes\n"
120 "The time unit for -a is seconds and for -t minutes by default. To " 125 "The time unit for -a is seconds and for -t minutes by default. To "
121 "specify\nseconds for the -t option, use the s suffix.\n" 126 "specify\nseconds for the -t option, use the s suffix.\n"
122 "Example: -t 150s\n\n" 127 "Example: -t 150s\n\n"
123 "Use '-' for PGN files to read PGN data from standard input\n" 128 "Use '-' for PGN files to read PGN data from standard input\n"

mercurial