util_opt: Correct util_opt_example to handle all possible options

The util_opt_example allows to specify '-l' and '-m, --manual' options,
but does not handle them. This leads to error message 'PANIC: The
application terminated due to an unrecoverable error' with 'Option 'l'
should not be handled here' and the program is aborted.

Add the required case statements in the switch to handle those options.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2019-07-09 16:04:28 +02:00
committed by Jan Höppner
parent 2c4c210ca8
commit 712433d7f9

View File

@@ -112,6 +112,12 @@ int main(int argc, char *argv[])
case OPT_NOSHORT:
printf("Specified: --noshort\n");
break;
case 'l':
printf("Specified: -l\n");
break;
case 'm':
printf("Specified: --manual\n");
break;
default:
util_opt_print_parse_error(c, argv);
return EXIT_FAILURE;