diff -r b2b20519ab23 -r eb2066405f79 src/relpipe-tr-validator.cpp
--- a/src/relpipe-tr-validator.cpp Sun Dec 02 18:17:52 2018 +0100
+++ b/src/relpipe-tr-validator.cpp Sun Dec 02 18:25:43 2018 +0100
@@ -16,11 +16,46 @@
* along with this program. If not, see .
*/
+#include
+#include
+
#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
using namespace relpipe::cli;
+using namespace relpipe::reader;
int main(int argc, char**argv) {
CLI cli(argc, argv);
- return 1;
+
+ int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
+
+ try {
+ std::shared_ptr reader(Factory::create(std::cin));
+ //TabularPrefetchingHandler handler(std::cout);
+ //reader->addHandler(&handler);
+ reader->process();
+
+ resultCode = CLI::EXIT_CODE_SUCCESS;
+
+ } catch (RelpipeCLIException e) {
+ fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessge().c_str());
+ fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
+ resultCode = e.getExitCode();
+ } catch (RelpipeReaderException e) {
+ fwprintf(stderr, L"Caught Reader exception: %ls\n", e.getMessge().c_str());
+ fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
+ resultCode = CLI::EXIT_CODE_DATA_ERROR;
+ }
+
+ return resultCode;
}