src/relpipe-tr-grep.cpp
branchv_0
changeset 25 98be80d2e65b
parent 24 c69670b7b4ef
child 27 1bf047cc60f5
equal deleted inserted replaced
24:c69670b7b4ef 25:98be80d2e65b
    41 int main(int argc, char**argv) {
    41 int main(int argc, char**argv) {
    42 	setlocale(LC_ALL, "");
    42 	setlocale(LC_ALL, "");
    43 	CLI::untieStdIO();
    43 	CLI::untieStdIO();
    44 	CLI cli(argc, argv);
    44 	CLI cli(argc, argv);
    45 
    45 
    46 	CLIParser cliParser;
       
    47 	Configuration configuration = cliParser.parse(cli.arguments());
       
    48 
       
    49 	int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
    46 	int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
    50 
    47 
    51 	try {
    48 	try {
       
    49 		CLIParser cliParser;
       
    50 		Configuration configuration = cliParser.parse(cli.arguments());
       
    51 		
    52 		std::shared_ptr<writer::RelationalWriter> writer(relpipe::writer::Factory::create(std::cout));
    52 		std::shared_ptr<writer::RelationalWriter> writer(relpipe::writer::Factory::create(std::cout));
    53 		std::shared_ptr<RelationalReader> reader(relpipe::reader::Factory::create(std::cin));
    53 		std::shared_ptr<RelationalReader> reader(relpipe::reader::Factory::create(std::cin));
    54 		GrepHandler handler(writer, configuration);
    54 		GrepHandler handler(writer, configuration);
    55 		reader->addHandler(&handler);
    55 		reader->addHandler(&handler);
    56 		reader->process();
    56 		reader->process();