| 2221 | } |
| 2222 | |
| 2223 | inline |
| 2224 | bool |
| 2225 | OptionParser::consume_positional(const std::string& a, PositionalListIterator& next) |
| 2226 | { |
| 2227 | while (next != m_positional.end()) |
| 2228 | { |
| 2229 | auto iter = m_options.find(*next); |
| 2230 | if (iter != m_options.end()) |
| 2231 | { |
| 2232 | if (!iter->second->value().is_container()) |
| 2233 | { |
| 2234 | auto& result = m_parsed[iter->second->hash()]; |
| 2235 | if (result.count() == 0) |
| 2236 | { |
| 2237 | add_to_option(iter, *next, a); |
| 2238 | ++next; |
| 2239 | return true; |
| 2240 | } |
| 2241 | ++next; |
| 2242 | continue; |
| 2243 | } |
| 2244 | add_to_option(iter, *next, a); |
| 2245 | return true; |
| 2246 | } |
| 2247 | throw_or_mimic<option_not_exists_exception>(*next); |
| 2248 | } |
| 2249 | |
| 2250 | return false; |
| 2251 | } |
| 2252 | |
| 2253 | inline |
| 2254 | void |