From 2cf088ec24c7e0b2cb2d650a0c89b5bc2c56e099 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 28 Sep 2010 03:04:38 +0200 Subject: RED-554: SNOW-623: Add support for boost 1.42 See http://redmine.imprudenceviewer.org/issues/554 --- linden/indra/newview/llcommandlineparser.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/linden/indra/newview/llcommandlineparser.cpp b/linden/indra/newview/llcommandlineparser.cpp index c74406b..36b0e71 100644 --- a/linden/indra/newview/llcommandlineparser.cpp +++ b/linden/indra/newview/llcommandlineparser.cpp @@ -59,7 +59,7 @@ namespace po = boost::program_options; -// *NTOE:MEP - Currently the boost object reside in file scope. +// *NOTE:MEP - Currently the boost object reside in file scope. // This has a couple of negatives, they are always around and // there can be only one instance of each. // The plus is that the boost-ly-ness of this implementation is @@ -162,6 +162,12 @@ public: return mIsComposing; } + // Needed for boost 1.42 + virtual bool is_required() const + { + return false; // All our command line options are optional. + } + virtual bool apply_default(boost::any& value_store) const { return false; // No defaults. @@ -268,7 +274,11 @@ bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp) { clp.options(gOptionsDesc); clp.positional(gPositionalOptions); - clp.style(po::command_line_style::default_style + // SNOW-626: Boost 1.42 erroneously added allow_guessing to the default style + // (see http://groups.google.com/group/boost-list/browse_thread/thread/545d7bf98ff9bb16?fwc=2&pli=1) + // Remove allow_guessing from the default style, because that is not allowed + // when we have options that are a prefix of other options (aka, --help and --helperuri). + clp.style((po::command_line_style::default_style & ~po::command_line_style::allow_guessing) | po::command_line_style::allow_long_disguise); if(mExtraParser) { -- cgit v1.1