mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-27 09:46:28 +00:00
testdisplay: Allow getopt to print error messages
By not assigning opterr, getopt will print its own error message that includes information about whether an option is unknown or just requires an additional argument. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
parent
ffdece38e2
commit
ce5becbb61
@ -723,7 +723,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
enter_exec_path( argv );
|
enter_exec_path( argv );
|
||||||
|
|
||||||
opterr = 0;
|
|
||||||
while ((c = getopt(argc, argv, optstr)) != -1) {
|
while ((c = getopt(argc, argv, optstr)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '3':
|
case '3':
|
||||||
@ -771,7 +770,6 @@ int main(int argc, char **argv)
|
|||||||
sscanf(optarg, "%d,%d", &specified_disp_id, &specified_mode_num);
|
sscanf(optarg, "%d,%d", &specified_disp_id, &specified_mode_num);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "unknown option %c\n", c);
|
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case 'h':
|
case 'h':
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user