From 5de78910db89e689e5f8fbcd1fdf9fa711fed347 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 17 Sep 2021 16:19:26 +0200 Subject: [PATCH] Add verbose option --- src/utictactoe.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utictactoe.c b/src/utictactoe.c index 5ad2cc2..9f965ca 100644 --- a/src/utictactoe.c +++ b/src/utictactoe.c @@ -42,7 +42,7 @@ int main(int argc, char* argv[]) { int optc; int cross_ai, round_ai = 0; int inception_level = 0; - bool contest_mode = false; + bool verbose, contest_mode = false; char * contest_file; static struct option long_opts[] = { @@ -118,14 +118,20 @@ int main(int argc, char* argv[]) { contest_mode = true; printf ("contest activated\n"); break; + + case 'v': + verbose = true; + break; + case 'V': printf("utictactoe %d.%d.%d\n", VERSION, SUBVERSION, REVISION); printf("This software implements a full ultimate tictactoe game.\n"); exit(EXIT_SUCCESS); + + case 'h': help(); exit(EXIT_SUCCESS); - default: fprintf(stderr, "Try `utictactie --help' for more information.\n"); exit (EXIT_FAILURE);