diff options
author | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
commit | 2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch) | |
tree | 95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/newview/llcommandlineparser.cpp | |
parent | Second Life viewer sources 1.20.6 (diff) | |
download | meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2 meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz |
Second Life viewer sources 1.20.7
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llcommandlineparser.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/linden/indra/newview/llcommandlineparser.cpp b/linden/indra/newview/llcommandlineparser.cpp index 8123632..45f33dc 100644 --- a/linden/indra/newview/llcommandlineparser.cpp +++ b/linden/indra/newview/llcommandlineparser.cpp | |||
@@ -291,12 +291,15 @@ bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp) | |||
291 | } | 291 | } |
292 | catch(LLCLPLastOption&) | 292 | catch(LLCLPLastOption&) |
293 | { | 293 | { |
294 | // Continue without parsing. | 294 | // This exception means a token was read after an option |
295 | std::string msg = "Found tokens past last option. Ignoring."; | 295 | // that must be the last option was reached (see url and slurl options) |
296 | llwarns << msg << llendl; | 296 | |
297 | mErrorMsg = msg; | 297 | // boost::po will have stored a malformed option. |
298 | // boost::po will have stored a mal-formed option. | ||
299 | // All such options will be removed below. | 298 | // All such options will be removed below. |
299 | // The last option read, the last_option option, and its value | ||
300 | // are put into the error message. | ||
301 | std::string last_option; | ||
302 | std::string last_value; | ||
300 | for(po::variables_map::iterator i = gVariableMap.begin(); i != gVariableMap.end();) | 303 | for(po::variables_map::iterator i = gVariableMap.begin(); i != gVariableMap.end();) |
301 | { | 304 | { |
302 | po::variables_map::iterator tempI = i++; | 305 | po::variables_map::iterator tempI = i++; |
@@ -304,7 +307,27 @@ bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp) | |||
304 | { | 307 | { |
305 | gVariableMap.erase(tempI); | 308 | gVariableMap.erase(tempI); |
306 | } | 309 | } |
310 | else | ||
311 | { | ||
312 | last_option = tempI->first; | ||
313 | LLCommandLineParser::token_vector_t* tv = | ||
314 | boost::any_cast<LLCommandLineParser::token_vector_t>(&(tempI->second.value())); | ||
315 | if(!tv->empty()) | ||
316 | { | ||
317 | last_value = (*tv)[tv->size()-1]; | ||
318 | } | ||
319 | } | ||
307 | } | 320 | } |
321 | |||
322 | // Continue without parsing. | ||
323 | std::ostringstream msg; | ||
324 | msg << "Caught Error: Found options after last option: " | ||
325 | << last_option << " " | ||
326 | << last_value; | ||
327 | |||
328 | llwarns << msg.str() << llendl; | ||
329 | mErrorMsg = msg.str(); | ||
330 | return false; | ||
308 | } | 331 | } |
309 | return true; | 332 | return true; |
310 | } | 333 | } |