equal
deleted
inserted
replaced
23 |
23 |
24 #include <relpipe/reader/Factory.h> |
24 #include <relpipe/reader/Factory.h> |
25 #include <relpipe/reader/RelationalReader.h> |
25 #include <relpipe/reader/RelationalReader.h> |
26 #include <relpipe/reader/RelpipeReaderException.h> |
26 #include <relpipe/reader/RelpipeReaderException.h> |
27 |
27 |
|
28 #include "Configuration.h" |
|
29 #include "CLIParser.h" |
28 #include "CSVHandler.h" |
30 #include "CSVHandler.h" |
29 #include "RelpipeCSVWriterException.h" |
31 #include "RelpipeCSVWriterException.h" |
30 |
32 |
31 using namespace relpipe::cli; |
33 using namespace relpipe::cli; |
32 using namespace relpipe::reader; |
34 using namespace relpipe::reader; |
37 CLI::untieStdIO(); |
39 CLI::untieStdIO(); |
38 |
40 |
39 int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
41 int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
40 |
42 |
41 try { |
43 try { |
|
44 CLIParser cliParser; |
|
45 Configuration configuration = cliParser.parse(cli.arguments()); |
42 std::shared_ptr<RelationalReader> reader(Factory::create(std::cin)); |
46 std::shared_ptr<RelationalReader> reader(Factory::create(std::cin)); |
43 CSVHandler handler(std::cout); |
47 CSVHandler handler(std::cout, configuration); |
44 reader->addHandler(&handler); |
48 reader->addHandler(&handler); |
45 reader->process(); |
49 reader->process(); |
46 |
50 |
47 resultCode = CLI::EXIT_CODE_SUCCESS; |
51 resultCode = CLI::EXIT_CODE_SUCCESS; |
48 |
52 |