diff -r a37196931f63 -r 7d6ac51c0d48 src/relpipe-in-xmltable.cpp --- a/src/relpipe-in-xmltable.cpp Wed Jul 24 12:15:10 2019 +0200 +++ b/src/relpipe-in-xmltable.cpp Wed Jul 24 15:53:42 2019 +0200 @@ -32,6 +32,8 @@ #include #include "XMLTableCommand.h" +#include "CLIParser.h" +#include "Configuration.h" using namespace relpipe::cli; using namespace relpipe::writer; @@ -45,6 +47,8 @@ int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; try { + CLIParser cliParser; + Configuration configuration = cliParser.parse(cli.arguments()); XMLCommand command; command.process(cin, cout); resultCode = CLI::EXIT_CODE_SUCCESS; @@ -52,6 +56,10 @@ fwprintf(stderr, L"Caught Writer 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; + } 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(); } // TODO: catch xmlpp::exception return resultCode;