-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add cli -c
parameter(s) to init vectors
#4363
Conversation
Thanks! |
What happens now if I want to override parameters which are normally set by the model file? old: model file parameters could be overridden by command line parameters |
Old error message for wrong usage:
New error message:
Throwing an error changes the error message which is presented to users. It also changes the result code from 1 to 134 on macOS (maybe also on Linux and Windows). Why not simply print the old error message? |
Responding to your first comment: It's not clear if you wonder if there is an issue here or you know there is an issue here. Regarding your second comment, yes, we should change this to print a simple error message. |
See the code in: tesseract/src/ccmain/tessedit.cpp Line 288 in 2e5a114
|
@stweil : Could it be like this? diff --git a/src/tesseract.cpp b/src/tesseract.cpp
index 08a65e14..6025af5f 100644
--- a/src/tesseract.cpp
+++ b/src/tesseract.cpp
@@ -462,7 +462,8 @@ static bool ParseArgs(int argc, char **argv, const char **lang, const char **ima
const std::string argument(argv[i + 1]);
const auto equal_pos = argument.find('=');
if (equal_pos == std::string::npos) {
- throw std::invalid_argument("Missing '=' in configvar assignment");
+ fprintf(stderr, "Missing = in configvar assignment\n");
+ return false;
}
// Extract key and value
const std::string key = argument.substr(0, equal_pos); |
see #4354