# HG changeset patch # User František Kučera # Date 1543771543 -3600 # Node ID eb2066405f795a9f70951123fb1c4ec099397fe3 # Parent b2b20519ab236f7b71060098b4823533afdfa0dd reader without any output 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; }