server/tests: invalid-option: print the bad argument

optind points to the next argument to parse.
This commit is contained in:
Uri Lublin 2013-07-09 12:49:56 +03:00
parent 694f4b9e57
commit cbcd9eea36

View File

@ -892,7 +892,7 @@ void spice_test_config_parse_args(int argc, char **argv)
while ((val = getopt_long(argc, argv, "", options, &option_index)) != -1) {
switch (val) {
case '?':
printf("unrecognized option %s", argv[optind]);
printf("unrecognized option '%s'\n", argv[optind - 1]);
goto invalid_option;
case 0:
break;