diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-09-16 19:57:57 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-09-16 20:02:12 +0100 |
| commit | 693d9a4861c7a6019c082c8d1f773c362a56e62e (patch) | |
| tree | 0e2c0b2cf05a87db00dd0032de0682328adb8b9c /src/parameters_parser.cc | |
| parent | afad50514b6653c1bfa767306d857f939de2eb02 (diff) | |
Store key hash in IdMap
Diffstat (limited to 'src/parameters_parser.cc')
| -rw-r--r-- | src/parameters_parser.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parameters_parser.cc b/src/parameters_parser.cc index 6448cca5..8ea0fc81 100644 --- a/src/parameters_parser.cc +++ b/src/parameters_parser.cc @@ -7,7 +7,7 @@ String generate_switches_doc(const SwitchMap& switches) { String res; for (auto& sw : switches) - res += " -" + sw.first + (sw.second.takes_arg ? " <arg>: " : ": ") + sw.second.description + "\n"; + res += " -" + sw.key + (sw.value.takes_arg ? " <arg>: " : ": ") + sw.value.description + "\n"; return res; } @@ -27,11 +27,11 @@ ParametersParser::ParametersParser(ParameterList params, if (it == m_desc.switches.end()) throw unknown_option(params[i]); - if (it->second.takes_arg) + if (it->value.takes_arg) { ++i; if (i == params.size() or params[i][0_byte] == '-') - throw missing_option_value(it->first); + throw missing_option_value(it->key); } } else @@ -54,7 +54,7 @@ Optional<StringView> ParametersParser::get_switch(StringView name) const { const auto& param = m_params[i]; if (param[0_byte] == '-' and param.substr(1_byte) == name) - return it->second.takes_arg ? m_params[i+1] : StringView{}; + return it->value.takes_arg ? m_params[i+1] : StringView{}; if (param == "--") break; |
