diff -r 17bb45570099 -r 4062b8436838 src/GuileHandler.h --- a/src/GuileHandler.h Sun Jan 27 17:57:03 2019 +0100 +++ b/src/GuileHandler.h Sun Feb 03 01:44:07 2019 +0100 @@ -38,6 +38,8 @@ #include +#include "Configuration.h" + namespace relpipe { namespace tr { namespace guile { @@ -51,6 +53,7 @@ private: std::wstring_convert> convertor; // TODO: support also other encodings or use always UTF-8 between C++ and Guile + Configuration configuration; shared_ptr relationalWriter; wregex relationNameRegEx; @@ -143,15 +146,16 @@ public: - GuileHandler(ostream& output, const vector& arguments) { + GuileHandler(ostream& output, Configuration& configuration, const vector& arguments) : configuration(configuration) { relationalWriter.reset(writer::Factory::create(output)); - // TODO: options and parser - if (arguments.size() == 2) { - relationNameRegEx = wregex(arguments[0]); - guileCodeWhereCondition = arguments[1]; + // FIXME: remove and work directly with configuration in startRelation() and attribute() + // i.e. support multiple relationConfigurations + if (configuration.relationConfigurations.size() == 1) { + relationNameRegEx = wregex(configuration.relationConfigurations[0].relation); + guileCodeWhereCondition = configuration.relationConfigurations[0].guileWhere; } else { - throw cli::RelpipeCLIException(L"Usage: relpipe-tr-guile ", cli::CLI::EXIT_CODE_UNKNOWN_COMMAND); + throw cli::RelpipeCLIException(L"FIXME: only single relationConfiguration is currently supported", cli::CLI::EXIT_CODE_UNKNOWN_COMMAND); } }