ref: 1da884db15b5fc84159b2dd6c1b12f0f02eb396c
parent: ef473de75aa6fc25bf142141b470f867ec6d009f
author: ISSOtm <[email protected]>
date: Sat Apr 9 09:54:21 EDT 2022
Handle processing errors appropriately Alter the return status accordingly, and print the error counts on exit
--- a/src/gfx/main.cpp
+++ b/src/gfx/main.cpp
@@ -706,7 +706,8 @@
// Do not do anything if option parsing went wrong
if (nbErrors) {
- return 0;
+ fprintf(stderr, "Conversion aborted after %ju error%s\n", nbErrors, nbErrors == 1 ? "" : "s");
+ return 1;
}
if (options.reverse()) {
@@ -715,6 +716,10 @@
process();
}
+ if (nbErrors) {
+ fprintf(stderr, "Conversion aborted after %ju error%s\n", nbErrors, nbErrors == 1 ? "" : "s");
+ return 1;
+ }
return 0;
}