Skip to content

Commit

Permalink
Print list of languages to stdout instead to stderr
Browse files Browse the repository at this point in the history
It is common practice for command line programs to print
user requested information on stdout.

This seems to be reasonable for Tesseract, too.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed May 16, 2016
1 parent 7e98c33 commit e59be55
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/tesseractmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ void SetVariablesFromCLArgs(tesseract::TessBaseAPI* api, int argc, char** argv)
void PrintLangsList(tesseract::TessBaseAPI* api) {
GenericVector<STRING> languages;
api->GetAvailableLanguagesAsVector(&languages);
fprintf(stderr, "List of available languages (%d):\n",
languages.size());
printf("List of available languages (%d):\n", languages.size());
for (int index = 0; index < languages.size(); ++index) {
STRING& string = languages[index];
fprintf(stderr, "%s\n", string.string());
printf("%s\n", string.string());
}
api->End();
}
Expand Down

0 comments on commit e59be55

Please sign in to comment.