diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-06-06 22:43:38 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-06-06 22:43:38 +0000 |
commit | ad332810078a0bbb8fa08fcbfdf3d756de6914f6 (patch) | |
tree | 1608b2db5d620d323673607ea7ddadfba9d58bda /indra/newview/llcommandlineparser.cpp | |
parent | a7d9a543e587ffe84b355db7a2e8193bfe6c68b6 (diff) |
QAR-650 - Viewer RC 9 merge -> release (post cmake)
merge release@88802 Branch_1-20-Viewer-2-merge-1@89178 -> release
Diffstat (limited to 'indra/newview/llcommandlineparser.cpp')
-rw-r--r-- | indra/newview/llcommandlineparser.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index a6e002a04d..f06a8abfe0 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -291,12 +291,15 @@ bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp) } catch(LLCLPLastOption&) { - // Continue without parsing. - std::string msg = "Found tokens past last option. Ignoring."; - llwarns << msg << llendl; - mErrorMsg = msg; - // boost::po will have stored a mal-formed option. + // This exception means a token was read after an option + // that must be the last option was reached (see url and slurl options) + + // boost::po will have stored a malformed option. // All such options will be removed below. + // The last option read, the last_option option, and its value + // are put into the error message. + std::string last_option; + std::string last_value; for(po::variables_map::iterator i = gVariableMap.begin(); i != gVariableMap.end();) { po::variables_map::iterator tempI = i++; @@ -304,7 +307,27 @@ bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp) { gVariableMap.erase(tempI); } + else + { + last_option = tempI->first; + LLCommandLineParser::token_vector_t* tv = + boost::any_cast<LLCommandLineParser::token_vector_t>(&(tempI->second.value())); + if(!tv->empty()) + { + last_value = (*tv)[tv->size()-1]; + } + } } + + // Continue without parsing. + std::ostringstream msg; + msg << "Caught Error: Found options after last option: " + << last_option << " " + << last_value; + + llwarns << msg.str() << llendl; + mErrorMsg = msg.str(); + return false; } return true; } |