From a3f3ab7e113e44309461b26399d627814f0ce4f9 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Thu, 17 Apr 2008 02:56:14 +0000 Subject: QAR-449 Viewer 1.20 RC 1 merge Branch_1-20-Viewer -r 84432 : 84760 -> release --- indra/newview/llcommandlineparser.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra/newview/llcommandlineparser.cpp') diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index 2f99ca1247..a6e002a04d 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -261,7 +261,7 @@ void LLCommandLineParser::addOptionDesc(const LLString& option_name, } } -bool parseAndStoreResults(po::command_line_parser& clp) +bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp) { try { @@ -269,24 +269,32 @@ bool parseAndStoreResults(po::command_line_parser& clp) clp.positional(gPositionalOptions); clp.style(po::command_line_style::default_style | po::command_line_style::allow_long_disguise); + if(mExtraParser) + { + clp.extra_parser(mExtraParser); + } + po::basic_parsed_options opts = clp.run(); po::store(opts, gVariableMap); } catch(po::error& e) { llwarns << "Caught Error:" << e.what() << llendl; + mErrorMsg = e.what(); return false; } catch(LLCLPError& e) { llwarns << "Caught Error:" << e.what() << llendl; + mErrorMsg = e.what(); return false; } catch(LLCLPLastOption&) { // Continue without parsing. - llwarns << "Found tokens past last option. Ignoring." << llendl; - + std::string msg = "Found tokens past last option. Ignoring."; + llwarns << msg << llendl; + mErrorMsg = msg; // boost::po will have stored a mal-formed option. // All such options will be removed below. for(po::variables_map::iterator i = gVariableMap.begin(); i != gVariableMap.end();) -- cgit v1.2.3