--- a/src/CLIParser.h Thu Jan 17 23:26:48 2019 +0100
+++ b/src/CLIParser.h Fri Jan 18 16:47:56 2019 +0100
@@ -40,7 +40,7 @@
else throw relpipe::cli::RelpipeCLIException(L"Missing CLI argument" + (i > 0 ? (L" after " + arguments[i - 1]) : L""), relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
}
- void addField(Configuration& c, string_t& group, string_t& name, std::vector<string_t>& aliases, std::map<string_t, string_t>& options) {
+ void addField(Configuration& c, string_t& group, string_t& name, std::vector<string_t>& aliases, std::vector<string_t>& options) {
if (group.size()) {
c.fields.push_back(RequestedField(group, name, aliases, options));
group.clear();
@@ -77,7 +77,7 @@
string_t currentGroup;
string_t currentName;
std::vector<string_t> currentAliases;
- std::map<string_t, string_t> currentOptions;
+ std::vector<string_t> currentOptions;
for (int i = 0; i < arguments.size();) {
string_t option = readNext(arguments, i);
@@ -89,14 +89,13 @@
} else if (option == OPTION_AS) {
currentAliases.push_back(readNext(arguments, i));
} else if (option == OPTION_OPTION) {
- string_t key = readNext(arguments, i);
- string_t value = readNext(arguments, i);
- currentOptions[key] = value;
+ currentOptions.push_back(readNext(arguments, i));
+ currentOptions.push_back(readNext(arguments, i));
} else {
throw relpipe::cli::RelpipeCLIException(L"Unsupported CLI option: " + option, relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
}
}
-
+
addField(c, currentGroup, currentName, currentAliases, currentOptions); // last field
}
return c;