src/CLIParser.h
branchv_0
changeset 16 6180161335be
parent 15 e7f05d7c4336
child 17 87a7607d5def
equal deleted inserted replaced
15:e7f05d7c4336 16:6180161335be
    54 
    54 
    55 	static const string_t OPTION_FILE;
    55 	static const string_t OPTION_FILE;
    56 	static const string_t OPTION_XATTR;
    56 	static const string_t OPTION_XATTR;
    57 	static const string_t OPTION_AS;
    57 	static const string_t OPTION_AS;
    58 	static const string_t OPTION_OPTION;
    58 	static const string_t OPTION_OPTION;
       
    59 	static const string_t OPTION_RELATION;
    59 
    60 
    60 	Configuration parse(const std::vector<string_t>& arguments) {
    61 	Configuration parse(const std::vector<string_t>& arguments) {
    61 		Configuration c;
    62 		Configuration c;
    62 
    63 
    63 		{
    64 		{
    76 				} else if (option == OPTION_AS) {
    77 				} else if (option == OPTION_AS) {
    77 					currentAliases.push_back(readNext(arguments, i));
    78 					currentAliases.push_back(readNext(arguments, i));
    78 				} else if (option == OPTION_OPTION) {
    79 				} else if (option == OPTION_OPTION) {
    79 					currentOptions.push_back(readNext(arguments, i));
    80 					currentOptions.push_back(readNext(arguments, i));
    80 					currentOptions.push_back(readNext(arguments, i));
    81 					currentOptions.push_back(readNext(arguments, i));
       
    82 				} else if (option == OPTION_RELATION) {
       
    83 					c.relation = readNext(arguments, i);
    81 				} else {
    84 				} else {
    82 					throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
    85 					throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
    83 				}
    86 				}
    84 			}
    87 			}
    85 
    88 
   112 
   115 
   113 const string_t CLIParser::OPTION_FILE = L"--" + RequestedField::GROUP_FILE;
   116 const string_t CLIParser::OPTION_FILE = L"--" + RequestedField::GROUP_FILE;
   114 const string_t CLIParser::OPTION_XATTR = L"--" + RequestedField::GROUP_XATTR;
   117 const string_t CLIParser::OPTION_XATTR = L"--" + RequestedField::GROUP_XATTR;
   115 const string_t CLIParser::OPTION_AS = L"--as";
   118 const string_t CLIParser::OPTION_AS = L"--as";
   116 const string_t CLIParser::OPTION_OPTION = L"--option";
   119 const string_t CLIParser::OPTION_OPTION = L"--option";
       
   120 const string_t CLIParser::OPTION_RELATION = L"--relation";
   117 
   121 
   118 }
   122 }
   119 }
   123 }
   120 }
   124 }