relpipe-in-cli.cpp
branchv_0
changeset 11 3798b6bc9aea
parent 10 77593735b057
child 12 bc6fe00dd831
equal deleted inserted replaced
10:77593735b057 11:3798b6bc9aea
     7 #include <RelpipeWriterException.h>
     7 #include <RelpipeWriterException.h>
     8 #include <Factory.h>
     8 #include <Factory.h>
     9 #include <TypeId.h>
     9 #include <TypeId.h>
    10 
    10 
    11 #include "CLI.h"
    11 #include "CLI.h"
       
    12 #include "Command.h"
       
    13 #include "ArgumentsCommand.h"
    12 
    14 
    13 int demo();
    15 int demo();
    14 
    16 
    15 int main(int argc, char** argv) {
    17 int main(int argc, char** argv) {
    16 	using namespace relpipe::cli;
    18 	using namespace relpipe::cli;
       
    19 	using namespace relpipe::in::cli;
    17 	using namespace relpipe::writer;
    20 	using namespace relpipe::writer;
    18 
    21 
    19 	setlocale(LC_ALL, "");
    22 	setlocale(LC_ALL, "");
    20 	CLI cli(argc, argv);
    23 	CLI cli(argc, argv);
    21 
    24 
    30 				arguments[i - 1] = cli.arguments()[i];
    33 				arguments[i - 1] = cli.arguments()[i];
    31 			}
    34 			}
    32 
    35 
    33 			if (action == L"demo") {
    36 			if (action == L"demo") {
    34 				resultCode = demo();
    37 				resultCode = demo();
       
    38 			} else if (action == L"generate") {
       
    39 				ArgumentsCommand command;
       
    40 				command.process(cin, cout, action, arguments);
    35 			} else {
    41 			} else {
    36 				fwprintf(stderr, L"Unknown command: %ls\n", action.c_str());
    42 				fwprintf(stderr, L"Unknown command: %ls\n", action.c_str());
    37 				resultCode = CLI::EXIT_CODE_UNKNOWN_COMMAND;
    43 				resultCode = CLI::EXIT_CODE_UNKNOWN_COMMAND;
    38 			}
    44 			}
    39 
    45