Add verbose option

This commit is contained in:
Yorick Barbanneau 2021-09-17 16:19:26 +02:00
parent 9f40993a49
commit 5de78910db

View file

@ -42,7 +42,7 @@ int main(int argc, char* argv[]) {
int optc; int optc;
int cross_ai, round_ai = 0; int cross_ai, round_ai = 0;
int inception_level = 0; int inception_level = 0;
bool contest_mode = false; bool verbose, contest_mode = false;
char * contest_file; char * contest_file;
static struct option long_opts[] = static struct option long_opts[] =
{ {
@ -118,14 +118,20 @@ int main(int argc, char* argv[]) {
contest_mode = true; contest_mode = true;
printf ("contest activated\n"); printf ("contest activated\n");
break; break;
case 'v':
verbose = true;
break;
case 'V': case 'V':
printf("utictactoe %d.%d.%d\n", VERSION, SUBVERSION, REVISION); printf("utictactoe %d.%d.%d\n", VERSION, SUBVERSION, REVISION);
printf("This software implements a full ultimate tictactoe game.\n"); printf("This software implements a full ultimate tictactoe game.\n");
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case 'h': case 'h':
help(); help();
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
default: default:
fprintf(stderr, "Try `utictactie --help' for more information.\n"); fprintf(stderr, "Try `utictactie --help' for more information.\n");
exit (EXIT_FAILURE); exit (EXIT_FAILURE);