Skip to content

Commit d4ed0f8

Browse files
committed
tesseractmain: Fail if bad command line option is given
Signed-off-by: Stefan Weil <[email protected]>
1 parent 8d3f811 commit d4ed0f8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/api/tesseractmain.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ static void ParseArgs(const int argc, char** argv, const char** lang,
339339
*image = argv[i];
340340
} else if (*outputbase == nullptr) {
341341
*outputbase = argv[i];
342+
} else {
343+
// Unexpected argument.
344+
fprintf(stderr, "Error, unknown command line argument '%s'\n", argv[i]);
345+
exit(1);
342346
}
343347
++i;
344348
}

0 commit comments

Comments
 (0)