diff -r 71b902e1c5ee -r e82aaf24b0fe src/relpipe-in-ods.cpp --- a/src/relpipe-in-ods.cpp Sun May 14 00:21:14 2023 +0200 +++ b/src/relpipe-in-ods.cpp Sun May 14 02:13:46 2023 +0200 @@ -1,6 +1,6 @@ /** * Relational pipes - * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) + * Copyright © 2023 František Kučera (Frantovo.cz, GlobalCode.info) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,8 +21,6 @@ #include #include -#include - #include #include #include @@ -30,13 +28,11 @@ #include -#include "XMLTableCommand.h" -#include "CLIParser.h" -#include "Configuration.h" +#include "ODSCommand.h" using namespace relpipe::cli; using namespace relpipe::writer; -using namespace relpipe::in::xmltable; +using namespace relpipe::in::ods; int main(int argc, char** argv) { setlocale(LC_ALL, ""); @@ -46,19 +42,14 @@ int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; try { - CLIParser cliParser; - Configuration configuration = cliParser.parse(cli.arguments()); - XMLCommand command; - command.process(cin, cout, configuration); + std::shared_ptr writer(Factory::create(cout)); + ODSCommand command(writer); + command.process(cin); resultCode = CLI::EXIT_CODE_SUCCESS; } catch (RelpipeWriterException& e) { fwprintf(stderr, L"Caught Writer 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()); resultCode = CLI::EXIT_CODE_DATA_ERROR; - } 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()); - resultCode = e.getExitCode(); } // TODO: catch xmlpp::exception return resultCode;