mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-22 23:36:30 +00:00
lib: always warn about unknown options
All tests can now register extra options, so there should not be any unknown options. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
parent
80d2c9bf82
commit
c584d5c671
@ -362,17 +362,9 @@ static int common_init(int argc, char **argv,
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
goto out;
|
goto out;
|
||||||
case '?':
|
case '?':
|
||||||
if (opterr) {
|
print_usage(command_str, help_str, true);
|
||||||
print_usage(command_str, help_str, true);
|
ret = -2;
|
||||||
ret = -2;
|
goto out;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Just ignore the error, since the unknown argument
|
|
||||||
* can be something the caller understands and will
|
|
||||||
* parse by doing a second getopt scanning.
|
|
||||||
*/
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ret = extra_opt_handler(c, option_index);
|
ret = extra_opt_handler(c, option_index);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -475,18 +467,7 @@ void igt_subtest_init(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
void igt_simple_init(int argc, char **argv)
|
void igt_simple_init(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int ret;
|
common_init(argc, argv, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
/* supress getopt errors about unknown options */
|
|
||||||
opterr = 0;
|
|
||||||
|
|
||||||
ret = common_init(argc, argv, NULL, NULL, NULL, NULL);
|
|
||||||
if (ret < 0)
|
|
||||||
/* exit with no error for -h/--help */
|
|
||||||
exit(ret == -1 ? 0 : ret);
|
|
||||||
|
|
||||||
/* reset opt parsing */
|
|
||||||
optind = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user