src: improve error message when using doctest options like '--dt-help'; add

doctest info to help.cpp
This commit is contained in:
Markus F.X.J. Oberhumer
2022-10-24 23:00:12 +02:00
parent 98fedef1a1
commit 983eb6d676
4 changed files with 22 additions and 10 deletions
+6 -2
View File
@@ -1159,8 +1159,12 @@ int upx_main(int argc, char *argv[]) {
argv0 = argv[0];
upx_compiler_sanity_check();
if (!upx_doctest_check(argc, argv)) {
fprintf(stderr, "%s: internal error: doctest failed\n", argv0);
int dt_res = upx_doctest_check(argc, argv);
if (dt_res != 0) {
if (dt_res == 2)
fprintf(stderr, "%s: doctest requested program exit; Stop.\n", argv0);
else
fprintf(stderr, "%s: internal error: doctest failed\n", argv0);
e_exit(EXIT_INIT);
}