--- a/src/relpipe-out-posixmq.cpp Fri Mar 04 01:40:50 2022 +0100
+++ b/src/relpipe-out-posixmq.cpp Fri Mar 04 21:30:08 2022 +0100
@@ -26,25 +26,28 @@
#include <relpipe/reader/RelpipeReaderException.h>
#include "PosixMQHandler.h"
+#include "CLIParser.h"
+#include "Configuration.h"
using namespace relpipe::cli;
using namespace relpipe::reader;
using namespace relpipe::out::posixmq;
int main(int argc, char**argv) {
- CLI cli(argc, argv);
+ setlocale(LC_ALL, "");
CLI::untieStdIO();
-
+ CLI cli(argc, argv);
+
int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
try {
+ CLIParser cliParser;
+ Configuration configuration = cliParser.parse(cli.arguments());
std::shared_ptr<RelationalReader> reader(Factory::create(std::cin));
- PosixMQHandler handler(std::cout);
+ PosixMQHandler handler(configuration);
reader->addHandler(&handler);
reader->process();
-
resultCode = CLI::EXIT_CODE_SUCCESS;
-
} catch (RelpipeCLIException e) {
fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessage().c_str());
fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());