]> git.cworth.org Git - grrobot/blobdiff - src/args.c
Add --watch option
[grrobot] / src / args.c
index 98aa80cb2feccd95ae3ffc1ed944fd34045ff214..aee5e940531a66a4ca54753aed555a419c779b12 100644 (file)
@@ -44,6 +44,7 @@ static struct argp_option options[] = {
     {"port",           'p', "PORT", 0, "Port of server"},
     {"user",           'u', "USERNAME", 0, "Username for conection"},
     {"game",           'g', "GAME", 0, "Game to join"},
+    {"watch",          'w', 0, 0,      "Watch instad of join"},
     { 0 }
 };
 
@@ -65,6 +66,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
     case 'g':
        args->game = arg;
        break;
+    case 'w':
+       args->watch = 1;
+       break;
 
     case ARGP_KEY_ARG:
        argp_usage (state);
@@ -101,6 +105,7 @@ args_parse(args_t *args, int argc, char *argv[])
     args->game = getenv ("RR_GAME");
     if (args->game == NULL)
        args->game = ARGS_GAME_DEFAULT;
+    args->watch = 0;
 
     return argp_parse (&argp, argc, argv, 0, 0, args);
 }