X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=src%2Fargs.c;h=1498dbb62ec4164634b408c36294c70dddbf4b56;hb=71804e890a43f01b8b2b41d5881398b4f21f79f6;hp=1f787d102fc12fee47d2592f12ae74c3b0c29e19;hpb=525161b8577c2c4dd9c7b3f8be79ec6d110ccedc;p=grrobot diff --git a/src/args.c b/src/args.c index 1f787d1..1498dbb 100644 --- a/src/args.c +++ b/src/args.c @@ -37,14 +37,13 @@ static char doc[] = "grrobot - Ricochet Robot using GTK+ and Xr"; static char args_doc[] = "[file]"; -static struct argp_option options[] = { - /* name, key, arg, flags, doc */ - {"host", 'h', "HOST", 0, "Host running RR server"}, - {"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 } +static struct option options[] = { + {"host", required_argument, 0, 'h'}, + {"port", required_argument, 0, 'p'}, + {"user", required_argument, 0, 'u'}, + {"game", required_argument, 0, 'g'}, + {"watch", no_argument, 0, 'w'}, + {0, 0, 0, 0} }; static error_t @@ -100,7 +99,7 @@ args_parse(args_t *args, int argc, char *argv[]) args->watch = 0; args->file = NULL; - + return 0; return argp_parse (&argp, argc, argv, ARGP_LONG_ONLY, NULL, args);