Closed perillo closed 5 months ago
The new test should probably be skipped, since it is preventing full testing.
For the next PRs I plan to improve the Python code running the test suite, so the tests should work without issues.
UPDATE Fixed the bug in #428.
That's a nice improvement of the option parsing, thanks a lot!
Currently, in case of an unrecognized option we get two error messages. The first is printed by
getopt_long
and the second is printed bykcov
error handler.An additional issue is that the
kcov
error handler printsoptopt
, but this value is0
(NULL character) in this case.Improve the error handler by using
optind
to get the offending option. This is done in a separate switch case, instead of the default case. Disablegetopt
error messages by settingopterr
to 0.Configure
getopt_long
to report a missing argument using a different error code, so that this can be handled in a separate switch case. Note however that this error is only reported when the option is the last argument.Update the
basic.TooFewArguments
andbasic.WrongArguments
test cases.TODO
Print useful error message in case of an invalid option argument. This PR will not implement it.