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/llappviewermacosx.cpp | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewermacosx.cpp') diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index a748545a3b..28314cb0ae 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -115,10 +115,35 @@ bool LLAppViewerMacOSX::init() return LLAppViewer::init(); } +// MacOSX may add and addition command line arguement for the process serial number. +// The option takes a form like '-psn_0_12345'. The following method should be able to recognize +// and either ignore or return a pair of values for the option. +// look for this method to be added to the parser in parseAndStoreResults. +std::pair parse_psn(const std::string& s) +{ + if (s.find("-psn_") == 0) + { + // *FIX:Mani Not sure that the value makes sense. + // fix it once the actual -psn_XXX syntax is known. + return std::make_pair("psn", s.substr(5)); + } + else + { + return std::make_pair(std::string(), std::string()); + } +} + bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) { + // The next two lines add the support for parsing the mac -psn_XXX arg. + clp.addOptionDesc("psn", NULL, 1, "MacOSX process serial number"); + clp.setCustomParser(parse_psn); + // First parse the command line, not often used on the mac. - clp.parseCommandLine(gArgC, gArgV); + if(clp.parseCommandLine(gArgC, gArgV) == false) + { + return false; + } // Now read in the args from arguments txt. // Succesive calls to clp.parse... will NOT override earlier @@ -131,7 +156,10 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) return false; } - clp.parseCommandLineFile(ifs); + if(clp.parseCommandLineFile(ifs) == false) + { + return false; + } // Get the user's preferred language string based on the Mac OS localization mechanism. // To add a new localization: -- cgit v1.2.3