equal
deleted
inserted
replaced
31 #include <relpipe/writer/RelpipeWriterException.h> |
31 #include <relpipe/writer/RelpipeWriterException.h> |
32 #include <relpipe/writer/Factory.h> |
32 #include <relpipe/writer/Factory.h> |
33 #include <relpipe/writer/TypeId.h> |
33 #include <relpipe/writer/TypeId.h> |
34 |
34 |
35 #include "GuileHandler.h" |
35 #include "GuileHandler.h" |
|
36 #include "CLIParser.h" |
36 |
37 |
37 using namespace relpipe::cli; |
38 using namespace relpipe::cli; |
38 using namespace relpipe::reader; |
39 using namespace relpipe::reader; |
39 using namespace relpipe::tr::guile; |
40 using namespace relpipe::tr::guile; |
40 |
41 |
44 CLI cli(argc, argv); |
45 CLI cli(argc, argv); |
45 |
46 |
46 int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
47 int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
47 |
48 |
48 try { |
49 try { |
|
50 CLIParser cliParser; |
|
51 Configuration configuration = cliParser.parse(cli.arguments()); |
49 std::shared_ptr<RelationalReader> reader(Factory::create(std::cin)); |
52 std::shared_ptr<RelationalReader> reader(Factory::create(std::cin)); |
50 GuileHandler handler(std::cout, cli.arguments()); |
53 GuileHandler handler(std::cout, configuration, cli.arguments()); |
51 reader->addHandler(&handler); |
54 reader->addHandler(&handler); |
52 reader->process(); |
55 reader->process(); |
53 |
56 |
54 resultCode = CLI::EXIT_CODE_SUCCESS; |
57 resultCode = CLI::EXIT_CODE_SUCCESS; |
55 |
58 |
66 exit(resultCode); |
69 exit(resultCode); |
67 } |
70 } |
68 |
71 |
69 int main(int argc, char**argv) { |
72 int main(int argc, char**argv) { |
70 scm_boot_guile(argc, argv, relpipeMain, nullptr); |
73 scm_boot_guile(argc, argv, relpipeMain, nullptr); |
71 return 999; // never reached – see exit(resultCode) above |
74 return 222; // never reached – see exit(resultCode) above |
72 } |
75 } |